11
3
Is there a command that allows searching a keyword in files under a directory with specific extension ?
The string grep -irn "string" ./path
gives a recursive search for all files under the directory./path
. My specific requirement is to search in all files under ./path
with an extension such as *.h
1If you're going to do that, be sure to put the
"*.h"
in quotes. – G-Man Says 'Reinstate Monica' – 2016-09-08T04:12:16.913It works with and without quotes – Ginu Jacob – 2016-09-08T04:43:52.087
3Now it does. Try creating a file called
foobar.h
in the current directory, and try it again. – G-Man Says 'Reinstate Monica' – 2016-09-08T05:56:36.300