In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
Grep (Global regular expression version) allows pattern lookup of text files, and grep supports basic regular expressions as well as its extended set. Grep has three variants: grep standard grep command egrep extends grep command, supports basic and extended regular expressions, but does not support\ Q mode range application fgrep fast grep command, allows you to find a string instead of a pattern, do not misunderstand fast In fact, the speed of grep is equivalent to the general format of grep: grep [option] basic regular expression [file] the basic regular expression here can use double quotes for characters: string parameters are best expanded with double quotes to avoid being misunderstood as shell commands, and can be used to find strings composed of multiple words. Use double quotes when calling variables, such as grep "$MYVAR", otherwise there will be no result. When invoking pattern matching, you should use the option of single quotation mark grep:-c outputs only the count of matching lines, such as grep-c "test" * .txt, which will display 4, which means that 4 lines containing test are case-insensitive (for single characters only) For example, grep-I "Bank" * .c is equivalent to grep-I "bank" * .c-h does not show file names when querying multiple files-l only outputs file names containing matching characters when querying multiple files-n displays matching lines and line numbers, and displays the number of lines before each line that displays content-s does not show error messages that do not exist or no matching text-v displays all lines that do not contain matching text Grep-v "test" abc.txt, which will display lines that do not contain "test"-w matches in words-E allows you to use extended patterns to match grep and regular expressions: regular expressions are best enclosed in single quotation marks to prevent parameters from being used as the beginning of the shell command ^ anchor lines such as:'^ grep' matches all lines that start with grep. The end of an anchored line such as: 'grep$' matches all lines ending in grep. . Matches a character that is not a newline character such as: 'gr.p' matches gr followed by any character followed by p. * matches zero or more previous characters such as:'* grep' matches all one or more spaces followed by the line of grep. . * used together to represent any character. [] matches a specified range of characters, such as'[Gg] rep' matches Grep and grep. [^] matches a character that is not within the specified range, such as:'[^ A-FH-Z] rep' matches a line that does not start with the letters AME F and HMI Z, followed by rep. The\ (..\) tag matches characters, such as'\ (love\)', and love is marked as 1. \ 'matches lines that contain words ending in grep. The character x\ {m\} is repeated for m times, for example:'0\ {5\} 'matches a line containing 5 os. X\ {m,\} repeat the character x at least m times, for example:'o\ {5,\} 'matches lines with at least 5 o. Repeat the character x at least m times and no more than n times, for example:'o\ {5jue 10\} 'matches the lines of 5 Murray 10 o. \ w match
CUUG
For more oracle video tutorials, please click: http://crm2.qq.com/page/portalpage/wpa.php?uin=800060152&f=1&ty=1&aty=0&a=&from=6
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.