Search text in list of files. Double search. Search files within a files
- by wormhit
I'm trying to execute double search within files and return file names.
I'm using
find ./ -iname '*txt' | xargs grep "searchtext" -sl
to find file names with 'searchtext' in them.
Command is returning a list of files.
How can I find "othersearchtext" in those already found files and show them in the same fashion?
#### EDITED
Answer:
grep -l "othersearchtext" $(find ./ -iname '*txt' | xargs grep "searchtext" -sl)