The tail command writes the file to standard output starting at the specified point. With the-f option of the tail command, you can easily see the log files that are being changed, TAIL-F filename will display the most up-to-date content on the screen, and constantly refresh, you are seeing the latest file content. can be used as monitoring or viewing status and so on.
1. Command format:
tail [Required Parameters] [select parameters] [file]
2. Command function:
Used to display the content at the end of the specified file, and is processed as input when the file is not specified. Common view log files.
3. Command parameters:
-F Loop Read
-Q does not display processing information
-V displays detailed processing information
Number of-c< > bytes displayed
-n< lines > Display rows
--pid=pid and-F, which means it ends after the process id,pid dead.
-S--sleep-interval=s is combined with-F to indicate sleep s seconds at each repetition interval
-Q--quiet--silent never output the header of the file name
4. Usage examples:
Example 1: Displaying the end of a file
Command:
Tail-n 5 Log.txt Display the last 5 lines of the file
Example 2: Looping through the contents of a file
Command:
Tail-f Log.txt
Ping 192.168.0.1 > Ping.log &//Ping remote host in background and output to file Ping.log; This technique can be used for more than one profile monitoring. Use CTRL + C to terminate.
Example 3: Displaying a file starting from line 5th
Command:
Tail-n +5 Log.txt
<end>
The end of the first learning task: The file directory Operations command. Just today Saturday, hey, tonight is going to have a good meal.
One Linux command per day (--tail) command