Reputation: 41
Im trying to look for a word like "numbers" in multiple files not just txt files using terminal. I have tried strings -r /media/E016-5484/* | grep numbers But it still doesn't work !
Upvotes: 0
Views: 5806
Reputation: 753
If I am not mistaken, you are looking for
grep numbers -r /media/E016-5484
From the manpage:
-r, --recursive
Read all files under each directory, recursively, following symbolic links only if they are on the command line. This is equivalent to the -d recurse option.
Upvotes: 1
Reputation: 261
let say you are looking for 1234 in all files which in name contain file_pattern
grep 1234 ` find . -name "*file_pattern*"`
or
find . -name "*file_pattern*" -exec grep 1234 {} \;
Upvotes: 4