Javatpoint Logo
Javatpoint Logo

Linux tail

The 'tail' command displays the last lines of a file. Its main purpose is to read the error message.

By default, it will also display the last ten lines of a file.

Syntax:

Example:

Linux File tail

Look at the above snapshot, last ten lines of the file 'jtp.txt' is displayed with the help of command "tail jtp.txt".


Linux tail -n

The 'tail -n' option displays the specified number of lines.

Syntax:

Example:

Linux File tail n

Look at the above snapshot, the last five lines of the file 'jtp.txt' is displayed with the help of "tail -n5 jtp.txt" command.


tail -c

The 'tail -c' option displays the specified number of bytes from the last.

Syntax:

Example:

Linux File tail c

Look at the above snapshot, the last 12 bytes of file 'jtp.txt' is displayed with the help of "tail -c12 jtp.txt" command.

Next TopicLinux cat




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA