man.lsPlain-English help for Unix commands

tail Show the last lines of a file

Prints the end of a file, ten lines by default. It is the standard way to check the latest entries in a log, and it can keep running to show new lines as they are written.

Synopsis

tail [-F | -f | -r] [-qv] [-b number | -c number | -n number] [file ...]

Common options

Option or formWhat it does
-n numberShow the last number lines instead of 10
-n +numberStart at line number and show everything from there to the end. tail -n +2 skips a header row
-fFollow the file: wait and print new lines as they are added. Stop with Ctrl-C
-FLike -f, but also notices if the file is renamed or replaced, as happens when logs rotate
-c numberCount in bytes instead of lines
-qDo not print the ==> name <== header when given several files
-rShow lines in reverse order, last line first. Available on macOS and BSD, not in GNU tail

Examples

Last 10 lines of a file
tail app.log
Last 3 lines
tail -n 3 notes.txt
Beta again
error: disk full
delta
Skip the header row of a CSV file
tail -n +2 data.csv
ana,red,7
bo,blue,3
cy,red,9
dee,blue,3
Find errors among the most recent log lines
tail -n 20 app.log | grep ERROR
2026-01-01 ERROR failed to open
2026-01-02 ERROR timeout
Watch a log as it grows
tail -f /var/log/system.log
Follow a log that gets rotated
tail -F /var/log/nginx/access.log

Notes

See also

Last reviewed 2026-10-07.