tail

Show the last lines of a file, or follow it

What it does

tail prints the end of a file, 10 lines by default; -n sets the number. The newest log entries are right there at the end.

With -f (follow) it keeps running and prints new lines as they are written to the file. That is how you watch server logs live. Quit with Ctrl+C.

Syntax

tail <file>
tail -n <number> <file>
tail -f <file>

Examples

Related commands

Practise · All commands