1、find + exec
find . -exec grep chrome {} \;
or
find . -exec grep chrome {} +
find
will execute grep
and will substitute {}
with the filename(s) found. The difference between ;
and +
is that with ;
a single grep
command for each file is executed whereas with +
as many files as possible are given as parameters to grep
at once.
2、find + xargs
find . | xargs grep 'chrome'
3、grep
grep -Hran "chrome"