Three trivial-looking tools you'll use forever
wc counts. head shows the top. tail shows the bottom. Each of them has just one or two flags worth knowing, and you'll wear those flags out.
wc — word count
wc -l file— line count. The 90% case.wc -w file— word count.wc -c file— byte count.wc -m file— character count (different from bytes for UTF-8).
From a pipe: find . | wc -l counts files. git log --oneline | wc -l counts commits. cat file | wc -c is the manual size of a file.
head — first N
head file— first 10 lines (default).head -n 20 file— first 20.head -n -5 file— all but the last 5 (GNU only).head -c 100 file— first 100 bytes.
tail — last N
tail file— last 10 lines.tail -n 50 file— last 50.tail -n +10 file— from line 10 onward.tail -f file— follow new lines as they're appended. Essential for live logs.tail -F file— follow even if the file is rotated.
The killer combo
tail -f /var/log/system.log | grep -i error — live error stream. find . -name '*.py' | head — preview a search. history | tail -20 — recent commands.