Back to commands

Hosting Operations

Read-only, can be slow

Find Empty Files in a Backup

You need to spot empty files inside a backup tree.

Command

find backup -type f -size 0 -print

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 every empty file is bad; lock files and intentional marker files can be expected.

Expected output

Paths to empty files in the backup directory.

System impact

Read-only, can be slow. Nothing changes. The command prints zero-byte regular files.

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

Recovery / rollback: no state is changed.

When to use it

Use after backup jobs, exports, or uploads where empty files may indicate failed writes.

When not to use it

Do not assume every empty file is bad; lock files and intentional marker files can be expected.

next steps

Related commands

Hosting Operations Can be slow

Find Files Newer Than a Backup Snapshot

Files newer than the last snapshot are the ones most likely missing from it.

find source -type f -newer backup/.snapshot -print | sort
Hosting Operations Can be slow

Compare Source and Backup File Lists

A backup can be missing files and still look plausible at a glance.

comm -3 <(find source -type f | sed 's#^source/##' | sort) <(find backup -type f | sed 's#^backup/##' | sort)
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
Hosting Operations Can be slow

List Largest Files in a Backup

Large backup files are where storage surprises usually start.

find backup -type f -printf '%s %p\n' | sort -nr | head
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.

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

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