Follow live, surviving log rotation
Cheat sheet · 10 commands
Viewing files
You rarely need an editor just to read a file. cat prints small files, less pages through big ones, head and tail show the ends, and tail -F turns a log into a live feed.
The 3 you will use every day
Page through: / search, G end, q quit
Everything except the first line (skip a CSV header)
The full sheet
- Print the whole fileguide ›
- Print with line numbersguide ›
- Page through: / search, G end, q quitguide ›
- Follow a growing file, Ctrl+C to browseguide ›
- First 20 linesguide ›
- Last 20 linesguide ›
- Follow live, surviving log rotationguide ›
- Everything except the first line (skip a CSV header)guide ›
- Count lines
- Show what changed between two filesguide ›
Practise these for real in the interactive course,
or keep every sheet, chapter and fix in one book: The Linux Command Line Handbook.