Search query: list files containing a certain term
To get a list of files that contain a certain term for the current directory you can use this command to find the search query:
1 |
$> grep -lr SEARCHTERM |
This shell command searches the current directory recursively (-r) and lists (-l) all files containing the search query SEARCHTERM. SEARCHTERM can also be a regular expression. Example result:
1 2 3 4 5 6 7 8 9 10 |
$> grep --files-with-matches -lr 111-6676-344 481778223228.txt 475848816199.txt 730820777094.txt 810870348459.txt 914638096613.txt 1457194942179.txt 1305990982378.txt 167510767421.txt 787152968260.txt |
If you […]