I'm looking for a search engine for lists of text strings in files. I do not use the programs that only look for a line because I need to search several text strings and that the program performs the search in all files with the extension .txt.
The list of text strings to search, is only for the program to search one by one in each of the files. Once the search is complete, the program should show those files that match one or more of a text string specified in the list.
You can use
grep
in command line:list
is a file containing a list of strings you are looking for, and it will look for them in all.txt
files where you have run the command.or for searching recursively:
Here is an example, I've got three files: "1.txt" "2.txt" and "3.txt".
1.txt:
2.txt:
3.txt:
list file contains:
After running
grep -Fl -f list *.txt
what is get is:-l
for showing only the file names.-f
defines a file which contains the list of strings-F
Interpret PATTERN as a list of fixed strings (instead of regular expressions)