The tail command is used to output the last part of a file to a standard device, usually a terminal, or to support an update operation, and when the document content changes, tail refreshes itself to ensure that you see the latest file content.
1. Tail-f filename
Monitors the trailing contents of the filename file (the default 10 lines, -200F monitors the last 200 rows), and refreshes the display on the screen. Exit, press CTRL + C.
2. Tail-n filename
Displays the last 20 lines of the filename, when the contents of the document change, the display does not refresh.
3. Tail-r-N-ten filename
Reverse displays the last 10 lines of the filename.
When you want to monitor the output of tomcat, you can use the following methods:
1. Switch to Tomcat's logs directory, for example: CD usr/local/tomcat6/logs
2.TAIL-200F Catalina.out
Press CTRL + C to terminate the output of the content, the output is garbled when you need to adjust the tool encoding format is UTF-8.
Commands similar to the tail feature are:
Cat Displays the contents of the archive starting from the first line.
The TAC starts displaying the contents of the archive from the last line.
More paging displays the contents of the archive.
Less is similar to more but supports page forward
Head only shows the previous lines
Linux Tail,cat,head Commands