Quote:
Originally Posted by andreqb
Hi everybody,
I have a list of ids and I need to find all files that contains this ids
|
By contain I assume you mean that the id is in the contents of the file; you seem to be checking for the id in the file name. If you mean to search for the ids in the contents of the files, try the following:
Code:
find . -type f -execdir fgrep -lf temp '{}' ';'
This will, for every file in the directory, call
Code:
fgrep -lf temp <filename>
The -l says to print out the name of the file if, and only if, it matches one of the patterns in
temp; no other output is generated.
As a side note, "fgrep" is the same as "grep -F", rendering a second -F unnecessary.