For Beginners

Three useful keys of tail util


tail – output the last part of files. Print the last 10 lines of each FILE to standard output. With more than one FILE, precede each with a header giving the file name.

With no FILE, or when FILE is -, read standard input.

Tail’s keys

Show last ‘num’ lines in file:

tail -n {{num}} {{file}}


tail -{{num}} {{file}}

For example

$ tail -2 /etc/hosts broadcasthost
::1             localhost

Show new lines in file interactively:

tail -f {{file}}

Show new lines in file interactively even after deletion:

tail -F {{file}}