tailf

Displays the last few lines of the specified file on the screen, usually used for trace output of log files.

Supplementary instructions

The tailf command is almost identical to tail -f, strictly speaking it should be more similar to tail --follow=name. It can also continue to track when the file is renamed, which is especially suitable for following the growth of a log file. Unlike tail -f, it will not access the disk file if the file is not growing. tailf is particularly suitable for tracking log files on portable computers because it saves power and reduces disk access. The tailf command is not a script, but a binary executable file compiled with C code. Some Linux installations do not have this command.

The difference between tailf and tail -f

grammar

tailf logfile # Dynamically track the log file logfile, initially printing the last 10 lines of the file.

Options

-n, --lines NUMBER # Output the last number of lines
-NUMBER # Same as NUMBER `-n NUMBER'
-V, --version # Output version information and exit
-h, --help # Show help and exit

Parameters

Target: Specify the target log.

Example

tailf log/WEB.LOG
tailf -n 5 log2014.log # Display the last 5 lines of the file