The tail command
Yaser Rahmati | یاسر رحمتی
The tail
command prints the last ten lines of a file.
Example:
Syntax:
Get a specific number of lines with tail
:
tail
:Use the -n
option with a number(should be an integer) of lines to display.
This command will display the last five lines of the file myfile.txt
.
Refresh the output on any new entry in a file
It is possible to let tail
output any new line added to the file you are looking into. So, if a new line is written to the file, it will immediately be shown in your output. This can be done using the --follow
or -f
option. This is especially useful for monitoring log files.
Syntax:
Additional Flags and their Functionalities
Last updated