grep -rnw '/path/to/somewhere/' -e 'pattern'

-r or -R is recursive,
-n is line number, and
-w stands for match the whole word.
-l (lower-case L) can be added to just give the file name of matching files.

 

https://stackoverflow.com/a/16957078/8025086

 

posted on 2019-12-19 22:27  Go_Forward  阅读(180)  评论(0编辑  收藏  举报