Linux grep query results are filtered

Updated on educate 2024-02-24
3 answers
  1. Anonymous users2024-02-06

    grep query filtering requires the use of the pipe command |.

    For example: 1. The command to find a specific process in the process table is usually as follows:

    When output, not only the process data that will be looked for is output, but the data that includes the grep process itself is emptied, because the lookup string is included in the grep call. The methods of filtering grep itself are:

    v: ignores grep itself.

    2. There is another way:

    The string you're looking for becomes a regular expression.

    Because the entry for the grep process shows that the processing command takes precedence over the regular expression ([s]ome string). When the grep command is run, the grep process's own entries don't match and are not included in the output.

    Use egrep to find multiple strings at once:

  2. Anonymous users2024-02-05

    In addition, because your current command will be displayed when you ps aux, grep opclient will filter out two records, and then use grep -v grep to filter out the current command, and only the command you want will remain.

    You use this command.

    pid= pgrep opcclient can be replaced, no need to be so troublesome!

    After adding, I can't find it, it may be that there is no process.,Didn't add it.,It's the process ID of your current command that was found.

  3. Anonymous users2024-02-04

    A common command method for Linux to find the contents of a file.

    1. Find the line that matches the specified string from the file content

    grep "The string being looked"Filename.

    Example: Look for the first level folder in the current directory that contains the specified string. in file.

    grep "thermcontact" *in

    2. Find the line that matches the regular expression from the content of the file:

    grep e "regular expression" filename.

    3. The manuscript check letter is not case-sensitive

    grep –i "The string being looked"Filename.

    4. Find the number of matching rows:

    grep -c "The string being looked"Filename.

    5. Find the line from the file content that does not match the specified string

    grep –v "The string being looked"Filename.

    6. Start from the root directory and look for all extensions. log and find the line that contains "error".

    find / type f -name "*log" |xargs grep "error"

    find . name "*in" |xargs grep "thermcontact"

Related questions
7 answers2024-02-24

First, pinch the middle of the rope first >>>More

7 answers2024-02-24

Some convenient and fast patent query ** or patent query platform are as follows: 1. The platform of the State Intellectual Property Office 2. The patent query platform of Wisdom Buds 3. The Wisdom Buds patent inquiry platform provides a one-stop information service platform for patent retrieval, analysis and management, and the company is committed to letting more organizations and institutions around the world understand and use patents more efficiently 4. The State Intellectual Property Office of China is the most directly subordinate agency in charge of patent work and the overall coordination of foreign-related intellectual property matters. It has intellectual property affairs such as patent application, patent examination, patent protection, patent**, PCT, integrated circuits, document services, important news, laws and regulations, and international cooperation. >>>More

3 answers2024-02-24

ka02601293345 2010-10-20 16:28:44 |Current Processing: Received |Processing agency: Laishan District University Branch. >>>More

12 answers2024-02-24

The National Health and Family Planning Commission of the People's Republic of China (formerly the Ministry of Health) opened an entrance for the majority of physicians to check their own medical practitioner registration information. Candidates can enter their registration province, name and verification code on the official medical practitioner qualification registration inquiry portal to query their physician registration information. >>>More

15 answers2024-02-24

<> "Look at the information, this postal ordinary package has been delivered today. The details of the receipt are ** point collection. >>>More