What does tail do?
tail shows the last lines of a file (10 by default). tail -f keeps the file open and prints new lines live — perfect for watching logs.
tail [-n N] [-f] file
Most useful options
| Option | What it does |
|---|---|
| -n N | last N lines |
| -f | follow: print new lines as they are written |
| -n +N | everything from line N |
tail examples
In security work
tail -f on auth.log during an incident shows attacks as they happen.
Questions about tail
How do I stop tail -f?
Press Ctrl+C.