Recipes that solve real questions
This lesson is a small cookbook. Each one-liner answers a concrete question with the tools you've now seen. Run them, modify them, save the patterns you'll reuse.
What's eating my disk?
du -sh ~/.* */ 2>/dev/null | sort -h | tailMost-used commands in my history
history | awk '{print $2}' | sort | uniq -c | sort -rn | headTop 10 IPs in an access log
awk '{print $1}' access.log | sort | uniq -c | sort -rn | headLines of code per language in a repo
find . -type f -name '*.*' \
| grep -vE 'node_modules|\.git|__pycache__' \
| awk -F. '{print $NF}' \
| sort | uniq -c | sort -rnAll TODOs by file
grep -rn TODO --include='*.py' --include='*.ts' \
--exclude-dir={node_modules,.git} . | headFind duplicate lines in a file
sort file | uniq -dConvert ISO timestamps to local time
awk '{cmd="date -j -f %Y-%m-%dT%H:%M:%S " $1 " +%H:%M"; cmd | getline lt; close(cmd); print lt, $0}'Strip ANSI color codes from a captured log
sed -E 's/\x1B\[[0-9;]*[mK]//g' colored.logWhat changed in the last 60 minutes?
find ~ -type f -mmin -60 -not -path '*/.cache/*' 2>/dev/nullShow only the URLs in my browser bookmarks export
grep -oE 'https?://[^"]+' bookmarks.html | sort -u | head