The tail command allows you to take a look at the last few lines of a file:

tail [FILE]

Here is an example:

image showing basic use of tail

We can see the last 10 lines of the file linhas.txt. This is the default behaviour of the tail command.

If it is desired to read a number of lines other than 10, the -n option can be used to specify the number of lines to output:

image showing tail with -n option

Using -n 5 option, tail displays only the last 5 lines from the file.

Learn more.

Most of modern Linux distributions allows you to omit the n when using the -n option.

For example:

image showing tail with -NUMBER option

Notice that tail -5 has the same effect of tail -n 5.

How to read a file starting with a specified line number.

If we place a + just before the number when using -n option, tail will begin printing from the specified line number:

image showing tail with -n option to start from a specified line number

The previous command tail -n +5 returned the content of file starting with the 5th line.

I use tail this way when I want to remove the header line of a CSV file. When the first line of a CSV file is the header line, I can remove it using tail -n +2 file.csv, which will output the content of file starting with the 2nd line.