The tail
command displays, by default, the last 10 lines of a text file. This
command is very useful when you are examining some recent activity in
log files.
Here is an example:
In the picture above you can see that the last 10 lines of the /var/log/messages file are displayed.
The tail command can be used with various options. For example, if you would like to display the last 5 lines of a file you can use the -n option:
Another option that you will find handy is the -f option. This option keeps the file open and displays new lines that are added to the file.
Here is an example:
In the picture above you can see that the last 10 lines of the /var/log/messages file are displayed.
The tail command can be used with various options. For example, if you would like to display the last 5 lines of a file you can use the -n option:
Another option that you will find handy is the -f option. This option keeps the file open and displays new lines that are added to the file.
Post a Comment