Hosting Operations
Read-only, can be slowList Largest Files in a Backup
You need to rank backup files by size.
Command
find backup -type f -printf '%s %p\n' | sort -nr | head
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 delete files just because they are large; confirm age, ownership, and restore value first.
Expected output
A largest-first list of backup files with byte counts.
System impact
Read-only, can be slow. Nothing changes. The command prints file sizes and paths sorted largest first.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use when backups are growing or a storage bill suddenly changes.
When not to use it
Do not delete files just because they are large; confirm age, ownership, and restore value first.
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.
$ find backup -type f -print | sort
backup/.snapshot
backup/app/config.yml
backup/content/index.md
backup/old-report.csv
backup/tmp/empty.cache
$ find backup -type f -printf '%s %p\n' | sort -nr | head
39 backup/app/config.yml
26 backup/content/index.md
13 backup/old-report.csv
0 backup/tmp/empty.cache
0 backup/.snapshot
View commands shown
These are the commands shown in the sanitized transcript.
Commands shown
find backup -type f -print | sortfind backup -type f -printf '%s %p\n' | sort -nr | head
next steps
Related commands
Rank Old Cleanup Candidates by Size
The oldest file is not always the file that buys back meaningful space.
find /lab/disk-inode-cleanup/var -xdev -type f -mtime +7 -printf '%s %TY-%Tm-%Td %p\n' | sort -nr | head
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
Find Directories Burning Inodes
Inode cleanup starts by finding the directory with too many files.
find /lab/disk-inode-cleanup/var/cache/app -xdev -type f -printf '%h\n' | sort | uniq -c | sort -nr | head
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
Show Release Directory Ages
See your newest release directories without opening a dashboard.
find releases/ -mindepth 1 -maxdepth 1 -type d -printf '%T@ %TY-%Tm-%Td %TH:%TM %p\n' | sort -nr | head -10 | cut -d' ' -f2-
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.
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.