Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Grep command- How to use in different directories

Tags:

linux

How to grep single word in different directory and file name is also same in different directory.

like image 319
Gurmeet Singh Avatar asked Aug 02 '13 05:08

Gurmeet Singh


1 Answers

I'm not sure to understand what you want.

Can't you just run

  grep -rwn word /some/dir1/ /other/dir2/

Read the GNU grep documentation!

like image 78
Basile Starynkevitch Avatar answered Nov 10 '22 10:11

Basile Starynkevitch