Linux Survival Basics
Read-only, can be slowFind the Largest CI Logs
A CI job is slow or hard to inspect because some logs are unexpectedly large.
Command
find logs/ -type f -printf '%s %p\n' | sort -nr | head -10
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 use it for compressed logs when you need uncompressed size analysis.
Expected output
The 10 largest log files with byte counts.
System impact
Read-only, can be slow. Nothing changes. The command reports the largest log files.
Scope this to the smallest useful path or service on busy systems.
Recovery / rollback: no state is changed.
When to use it
Use when log uploads are slow or a job output is unusually noisy.
When not to use it
Do not use it for compressed logs when you need uncompressed size analysis.
next steps
Related commands
Find the Files Eating Your Disk
The disk was full, but guessing at folders was the slow part.
find /var -type f -printf '%s %p\n' | sort -nr | head -20
Show Big Files in Human Units
Byte counts are precise. Human units are faster under pressure.
find /var -type f -printf '%s %p\n' | sort -nr | head -10 | awk '{printf "%.1f MB %s\n", $1/1024/1024, $2}'
Count Source Files by Extension
A quick extension count can show whether expected content made it into the source tree.
find source -type f -printf '%f\n' | sed -n 's/.*\.//p' | sort | uniq -c | sort -nr
Count Failures by Test File
Turn noisy test logs into a ranked failure list.
grep -RhoE '[A-Za-z0-9_./-]+\.(test|spec)\.(js|ts|py|rb)' logs/ | sort | uniq -c | sort -nr | head
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.
Independent study support only. No affiliation, endorsement, exam dumps, or real exam questions.