In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to use the common command rgrep in Linux. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The Linux rgrep command is used to recursively find strings that match the criteria in the file. The function of the rgrep directive is similar to that of the grep directive. It can find files containing the specified template style. If the contents of a file are found to match the specified template style, the default rgrep directive will display the column containing the template style.
Syntax rgrep [-? BcDFhHilnNrv] [- R] [- W] [- x] [--help] [--version] [template style] [file or directory.]
Number of parameters:
-? Displays a description of the template style and example. -B ignores binary data. -c calculates the number of columns that match the template style. -D debug mode, which only lists the directories searched by the instruction and does not read the contents of the file. -F when a symbolic link is encountered, the rgrep default is ignored and not processed. With this parameter added, the rgrep instruction will read the contents of the original file that the connection points to. -h specifically marks the strings that conform to the template style. -H lists only strings that match the template style, not the contents of the entire column. -I ignore the difference in character case. -l lists the file names whose contents match the specified template style. -n Mark the column number of the column before displaying the column that matches the square style. -N do not deal with recursion. -r Recursive processing, processing all files and subdirectories under the specified directory together. The effect of this parameter is similar to that of specifying the "- r" parameter, but only files that mainly match the name of the template style file. -v reverse lookup. -W limits the number of characters that must be in the column of a string that matches the template style. -x only processes files that match the file name of the specified extension. -help online help. -version displays version information. Example
To find files in the current directory that contain the string "Hello" in the sentence, you can use the following command:
Rgrep Hello *
The search results are as follows:
$rgrep Hello * # find sentences containing "Hello" string in the current directory testfile_1:Hello 95 # testfile_1 sentences containing "Hello" string testfile_2:Hello 2005 # testfile_2 sentences containing "Hello" string
Thank you for reading! This is the end of the article on "how to use rgrep in Linux". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!
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.