Several parameters of grep matching

Source: Internet
Author: User

Grep-o

grep ignores matching own PS aux | grep python will always see a match that contains grep, which is not in line with our matching expectations. This can be filtered out of the grep match. The following command can be used to implement

grepgrepgrep
Grep-f

Grep-f is equivalent to Fgrep. Egrep is equivalent to GREP-E.
Here's the information we found.

You had a file with a list of say ten Unix usernames in plain text. You want to search the group file on your machine to see if any of the ten users listed is in any special groups:

-F-f user_list.txt /etc/group

The reason The-f switch helps here is, the usernames in your pattern file is interpreted as plain text strings. Dots For example would is interpreted as dots rather than wild-cards. -F indicates that the content is read from User_list.txt.

Grep-o

The Grep-o output matches the content.

Grep-e

A regular expression that supports extensions.

Several parameters of grep matching

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.