开发者

Searching within a whole directory and sub directories for a certain phrase

开发者 https://www.devze.com 2022-12-17 10:58 出处:网络
I\'m having difficaul开发者_开发百科tiesSearching within a whole directory and sub directories for a certain phrase using grep or a better command in linux to find a sentense\'

I'm having difficaul开发者_开发百科tiesSearching within a whole directory and sub directories for a certain phrase using grep or a better command in linux to find a sentense'

I use the following command grep -rni this is a test * but it seems not to search correctly.

Am I doing something wrong?


you need to quote your search term

grep -rin "this is a test" *


Add quotes to your search term. Otherweise, grep interpretes "this", "is", "a" and "test" as arguments.

the following should work:

grep -rin "this is a test" *
0

精彩评论

暂无评论...
验证码 换一张
取 消