The tail command prints the last lines (10 lines by default) of one or more files. The syntax for the tail command is as follows:
Syntax:
$ tail [OPTION]... [FILE]...
In its simplest form, when used without any option, the tail command displays the last ten lines.
Example:
$ tail file1.txt
Use the -n option followed by an integer specifying the number of lines to be shown:
Syntax:
$ tail -n filename.txt
$ tail -n 30 file1.txt
The same can be written as:
$ tail -30 file1.txt
The -c option allows printing a specific number of bytes:
Syntax:
$ tail -c filename.txt
$ tail -c 100 file1.txt
If multiple files are provided as input to the tail command, it will display the last ten lines from each provided file.
Example:
$ tail filename1.txt filename2.txt