For more information about the grep command, see grep Regular Expressions and options.
The most frequently used parameter is-V, but it is not easy to use.
For example, I want to find a word "userservice", but files like "*. SVN" do not need to be displayed. What should I do?
Grep-R "userservice"./| grep-V "SVN"
However, if I do not display files such as "test, auto_load", what should I do? My previous practices are:
Grep-R "userservice"./| grep-V "SVN" | grep-V "test" | grep-V "auto_load"
The command is very long and troublesome, so I thought that grep itself serves as an option based on a regular expression. Can I use the "or |" command of a regular expression?
Grep-R "userservice"./| grep-V "SVN | test | auto_load"
Obviously, the execution result shows that the above command does not meet my needs, so I am puzzled. It turns out that when you use the regular expression option, remember to escape "|. The final command is as follows:
Grep-R "userservice"./| grep-V "SVN \ | prj \ | test \ | auto_load"