Hello I have file with filesnames, it looks like:
names.txt:
first.html
second.html
third.html
I need to search trough all that files and return those which does not contain a pattern. How can I do that.
Hello I have file with filesnames, it looks like:
names.txt:
first.html
second.html
third.html
I need to search trough all that files and return those which does not contain a pattern. How can I do that.
grep accepts multiple files as input, and the option you're looking for is -L
$ grep -L pattern $(cat filenames.txt)
Example:
$ cat filenames.txt
first.html
second.html
third.html
$ cat first.html
2
4
$ cat second.html
1
2
3
4
5
$ cat third.html
4
5
6
7
8
9
10
$ grep -L 2 $(cat filenames.txt)
third.html