Linux Tail,cat,head Commands

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.