Back to commands

Hosting Operations

Read-only, can be slow

Check Whether Expected Build Outputs Exist

A deploy or packaging step cannot find files, and you need to verify the build output tree before debugging the deploy tool.

Command

find artifacts/dist -maxdepth 2 -type f | sort

Before you run this

System impact: Read-only. Can create load on large logs, directories, filesystems, or process tables.

When not to use it: Do not assume files are correct just because they exist; inspect sizes and content as needed.

Expected output

A sorted manifest of files under artifacts/dist.

System impact

Read-only, can be slow. Nothing changes. The build output files are listed.

Scope this to the smallest useful path or service on busy systems.

Recovery / rollback: no state is changed.

When to use it

Use when deploy, packaging, or static hosting steps complain about missing files.

When not to use it

Do not assume files are correct just because they exist; inspect sizes and content as needed.

Explanation-only example

Illustrated output, not a live lab run

This example is intentionally illustrative. It shows the command shape without killing real processes or changing your machine.

demo@lab:~$

$ cd /work/ci-artifacts && find artifacts/dist -maxdepth 2 -type f | sort

artifacts/dist/assets/main.js
artifacts/dist/assets/vendor.js
artifacts/dist/index.html

$ cd /work/ci-artifacts && find artifacts/dist -maxdepth 2 -type f -printf '%s %p\n' | sort -nr

831488 artifacts/dist/assets/vendor.js
250880 artifacts/dist/assets/main.js
77 artifacts/dist/index.html

$ cd /work/ci-artifacts && test -f artifacts/dist/index.html && echo 'index present'

index present
View commands shown

These are the commands shown in the sanitized transcript.

Commands shown

  1. cd /lab/ci-artifacts && find artifacts/dist -maxdepth 2 -type f | sort
  2. cd /lab/ci-artifacts && find artifacts/dist -maxdepth 2 -type f -printf '%s %p\n' | sort -nr
  3. cd /lab/ci-artifacts && test -f artifacts/dist/index.html && echo 'index present'

next steps

Related commands

Hosting Operations Can be slow

Find the Newest Build Logs First

The failing file is usually one of the newest artifacts.

find artifacts logs -type f \( -name '*.log' -o -name '*.txt' \) -printf '%TY-%Tm-%Td %TH:%TM %p\n' | sort -r | head
Hosting Operations Can be slow

List Newest Build Artifacts

Confirm what your pipeline actually produced before you deploy it.

find artifacts/ -type f -printf '%TY-%Tm-%Td %TH:%TM %10s %p\n' | sort | tail -20
Hosting Operations Can be slow

List Restore Points Before a Drill

A restore drill starts by proving which backups actually exist.

cd restore-dr && find backups -maxdepth 2 -type f -name MANIFEST.txt -printf '%TY-%Tm-%Td %TH:%TM %h\n' | sort -r
Hosting Operations Can be slow

Find the Largest CI Artifacts

A bloated artifact can explain a slow or failed pipeline.

find artifacts -type f -printf '%s %p\n' | sort -nr | head -10
Hosting Operations Can be slow

Find System Cron Files Fast

A job can be nowhere in your crontab and still run every night.

find /etc/cron.d /etc/cron.hourly /etc/cron.daily /etc/cron.weekly /etc/cron.monthly -maxdepth 1 -type f -print 2>/dev/null | sort
Study mapping

Use this as independent command practice: read the notes, predict the output, then compare it with the example before using a real shell.

  • lpic1:103-gnu-unix-commands
  • lpic1:104-filesystems-permissions-fhs
  • lfcs:essential-commands
  • lfcs:operations-deployment
  • lfcs:services-logs
  • lfcs:storage
  • linuxplus:automation-scripting
  • linuxplus:provisional
  • linuxplus:system-management
  • risk:read-only

Useful for

  • LPIC-1 style command-line practice
  • LFCS style performance tasks
  • Linux+ style troubleshooting review

Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.