tail Linux Commands
What is Linux tail Command?
Explanation
tail COMMAND:tail command is used to display the last or bottom part of the file. By default it displays last 10 lines of a file.
SYNTAX :
tail [options] filename
OPTIONS:
-l |
To specify the units of lines. |
-b |
To specify the units of blocks. |
-n |
To specify how many lines you want to display. |
-c number |
The number option-argument must be a decimal integer whose sign affects the location in the file, measured in bytes. |
-n number |
The number option-argument must be a decimal integer whose sign affects the location in the file, measured in lines. |
EXAMPLE:
-
tail index.php
It displays the last 10 lines of 'index.php'.
-
tail -2 index.php
It displays the last 2 lines of 'index.php'.
-
tail -n 5 index.php
It displays the last 5 lines of 'index.php'.
-
tail -c 5 index.php
It displays the last 5 characters of 'index.php'.