Linux Command - tail

tail - output the last part of files.

Syntax

1
tail [OPTION] [FILE]...

Description

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.

Option Description
-c, –bytes=K output the last K bytes;
-n, –lines=K output the last K lines, instead of the last 10
-f output appended data as the file grows

Example

show the last lines of log1

1
tail log1

show last 5 lines of log1

1
tail -n log1

show the last lines of log1 live

1
tail -f log1

use Ctrl+C to exit

Reference