Output the last N lines of a file; follow live output.
low risk
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.
| Flag | Meaning |
|---|---|
-n --lines | Output the last N lines |
-f --follow | Follow file growth in real time |
-F --follow-name | Follow by filename (survives log rotation) |
-c --bytes | Output the last N bytes |
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 →Use `tail -F` instead of `tail -f` in production log monitoring — it reconnects when the file is rotated, preventing silent monitoring gaps.
Reference text is hand-written and may be incomplete — check man tail for your version. Test destructive commands on a non-production system first.