In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >
Share
Shulou(Shulou.com)06/01 Report--
Grep: grep,egrep,fgrep, text search tool, fuzzy search for given text based on PATTERN. GREP works in greedy mode by default.
Grep:
Grep [OPTIONS] PATTERN [FILE...]
PATTERN: the filter condition consists of regular expression metacharacters and text characters that have no special meaning.
Regular expression metacharacters:
Will be interpreted as a special meaning by the regular expression engine. Regular expression engine for the pcre--perl language.
Basic regular expression: BRE
Extended regular expression: ERE
Grep only supports basic regular expressions by default
Egrep only supports extended regular expressions by default.
Fgrep does not turn on the regular expression engine by default
Text characters:
Those characters that have only one-sided meaning
Common options:
-I,-- ignore-case ignores the case of text characters
-v,-- invert-match match in reverse, and the final result is the row that PATTREN cannot match
-c,-- count counts all rows that match PATTERN
-o,-- only-matching turns off greedy mode and displays only what PATTERN can match
-Q,-- quiet,-- silent does not output any matching results
-- color [= WHEN],-- colour [= WHEN] displays the contents of the matching PATTREN in a special color
-E,-- extended-regexp extended regular expression grep-E is equivalent to egrep
-F,-- fixed-strings,-- fixed-regexp is equivalent to fgrep
-G,-- basic-regexp basic regular expression, egrep-G is equivalent to grep
-P,-- perl-regexp uses the PCRE engine
-A NUM,-- after-context=NUM displays the rows that match the PATTERN and the NUM lines that follow them
-B NUM-- before-context=NUM
PATTERN
Regular expression metacharacters:
Basic regular expression metacharacters:
GLOBBING- simplified version of regular expression: []? *
Character matching:
.: match any single character
[]: matches any single character in the specified range
[^]: matches any single character outside the specified range
All of the following character sets can be placed in [] to match a single character
[: lower:]
[: upper:]
[: alpha:]
[: digit:]
[: space:] Spac
[: alnum:]
[: punct:]
[: blank:]
[: xdigit:]: all hexadecimal numbers
Amurz: all lowercase letters
Amurz: all capital letters
0-9: all decimal numbers
Number of times matching: the number of times that a character before this class can appear
*: the character in front of it can appear any number of times (0, 1 or more times)
The character in front of it is optional (0 times or once)
\ +: the character preceding it appears at least once (1 or more times)
\ {m\}: the character before it must appear m times
\ {mdirection n\}: at least m times and at most n times (m)
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.