The Archives
-
03.02.09Adding ‘tail -f’ behavior to ‘less’$ less +F /var/log/messages The +F option turns on less 'follow mode'. It is similar to tail -f but you will have the benefits of less, like scrolling up and down. To stop tailing, use Ctrl-C and to resume it, press Shift-F.
-
02.20.09Displaying last lines of a file in real time$ tail -f /var/log/messages Displays continously (in "real time") the last lines of /var/log/messages as it grows.
-
11.17.08Output last lines of a file$ tail -20 test.txt Outputs the last 20 lines of file test.txt
-
08.15.08Looking at the EndFrom time to time we want to see only a few lines near the end of a file. We often use cat or more, but this can be tedious when the file is big (like a very long log file). You can use these commands to read from the end of the file: tac. It works exactly as cat but reading from the end of the file tail. It reads from the end of the file. It has more features than tac. The one I found to be more interesting is the -f flag. It makes tail to continue reading from the ...