For a simple file search you could use grep's
-l
and -r
options:
grep -rl
"mystring"
All the
search is done by grep. Of course, if you need to select files on some other parameter,
find is the correct solution:
find
. -iname "*.php" -execdir grep -l "mystring" {}
+
The
execdir
option builds each grep command per each directory, and
concatenates filenames into only one command
(+
).
No comments:
Post a Comment