Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the rgrep command of linux to find qualified strings in the file

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

In this article, let's learn about using linux's rgrep command to find qualified strings in a file. There is a certain reference value, friends in need can refer to, hope to help you.

The function of the rgrep command is similar to the grep command, you can find files that contain the specified template style, and if the contents of a file are found to match the specified template style, the default rgrep command will display the column containing the template style.

Syntax format: rgrep [parameters]

Common parameters:

-? Show description of the template style and example-B ignores binary data-c calculates the number of columns that conform to the template style-D debugging mode, and lists only the list of directories searched by the command. F only reads the contents of the original file pointed to by the connection-h specifically marks strings that match the template style-H lists only strings that match the template style Instead of displaying the contents of the entire column-I ignore the difference in character case-l lists the file names that match the specified template style-n before displaying the column that matches the local style, the column number marked with this column-N do not recursively process-r recursive processing, all files and subdirectories under the specified directory are processed together-R this parameter has a similar effect to the specified "- r" parameter. But only the main file that matches the file name of the template style-v reverse search-W restricts the column of the string that meets the template style, and the number of characters that must be owned-x only handles files that match the file name of the specified extension-help display help information-version display version information

Reference example

Find the file in the current directory that contains the string "Hello" in the sentence:

[root@linuxcool ~] # rgrep Hello *

Show a description of the template style and example:

[root@linuxcool] # rgrep -? The above is a brief introduction to the use of linux's rgrep command to find qualified strings in the file, of course, the detailed use of the above differences still have to be used by everyone to understand. If you want to know more, welcome to follow the industry information channel!

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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report