Use the VI command to delete all the content in the log and monitor the log in real time.

Source: Internet
Author: User

Many times we apply ProgramYou need to view log files for troubleshooting. However, there are usually many logs generated by our previous applications. When there are too many other logs, sometimes it is a little effort to look at the logs generated by the current application. At this time, we may want to clear the previous logs to make the current logs clear:

VI test. Log

: 0, $ d
: WQ

Note: 0, $ d Indicates deleting the 0th rows to the last row; WQ indicates saving and exiting.
Run the following command to monitor the content in test. Log in Real Time:

Tail-F test. Log

Note: The tail command is to view the last 10 lines of the test. log file. The-F parameter indicates that the value is changed as the test. Log File increases.

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.