tail

Output the last N lines of a file; follow live output.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

tail outputs the last N lines (default 10). The -f flag follows a file as it grows — the standard way to monitor live logs. -F is more robust than -f as it handles log rotation.

Common flags
FlagMeaning
-n --linesOutput the last N lines
-f --followFollow file growth in real time
-F --follow-nameFollow by filename (survives log rotation)
-c --bytesOutput the last N bytes
Examples
tail -f /var/log/nginx/error.logLive-follow nginx error log · explain & risk-check →
tail -n 100 /var/log/syslogView last 100 syslog entries · explain & risk-check →
tail -F /var/log/app.log | grep ERRORStream and filter errors in real time · explain & risk-check →
tail -n +2 data.csvSkip header row (output from line 2 onward) · explain & risk-check →
Pro tip

Use `tail -F` instead of `tail -f` in production log monitoring — it reconnects when the file is rotated, preventing silent monitoring gaps.

Related
head journalctl less
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man tail for your version. Test destructive commands on a non-production system first.