10:01 PM Difference between tailf and tail -f in Linux |
Today, we shall talk about one of the most frequently used command in Linux. TAIL The command is used to print last 10 lines of a file. tail -f is used to print the last 10 lines plus it keeps on reading the file if a new data is added to the file. tail -f can be used if a log is currently being updated. But then what is the use of tailf? tailf is similar to tail -f except one difference that tailf does access the file if the file is not being updated or not growing.
tailf is extremely useful for monitoring log files on a laptop when logging is infrequent and the user desires that the hard disk spin down to conserve battery life.
It means that tail -f will keep on accessing/reading the file even if its not growing. This has the side effect of not updating the access time for the file, so a filesystem flush does not occur periodically when no log activity is happening.
The tailf command is part of the util-linux-ng package So now that you know about tailf, start using tailf instead of tail -f to conserve energy :). |
|
Related blogs
You may also like to see:
[2015-08-18] | [Open System-Linux] |
How to open a PDF file or a Postscript file in Linux - Evince Document viewer? |
[2014-09-13] | [Open System-Linux] |
md5sum: calculate and check md5 message digest of a file in Linux |
[2016-01-23] | [Open System-Linux] |
Some useful examples of netstat command in Linux for network statistics |
[2015-06-16] | [Open System-Linux] |
Alien command : convert files from one form to another, install binary packages |
[2015-01-18] | [Open System-Linux] |
The JAR archiving tool in Linux |
Total comments: 0 | |