SSH View server log common statements

Source: Internet
Author: User

SSH Client View server log Common statements are common statements for Linux for file viewing in folders:

1. cd

2, tail

3. grep [Options] Pattern file

-C: Outputs only the count of matching rows.
-I: Case insensitive (only for single-character).
-H: The file name is not displayed when querying multiple files.
-L: Only file names that contain matching characters are output when querying multiple files.
-N: Displays matching lines and line numbers.
-S: does not display error messages that do not exist or have no matching text.
-V: Displays all lines that do not contain matching text.

In the face of huge log files, download and open files separately, extract information from it, it is very laborious. At this point, the grep statement is important. such as tracking a log of a business process code:

The key word is: TotalCount

>grep ' TotalCount ' Info.log

Reverse query:-V

>grep-v ' Searchecif ' Info.log

4, more

5, LS

6.

SSH View server log common statements

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.