How can I print a filename if the file doesn't contain a string?
grep -vl 'string' file
always prints file
, I guess because there is at least one line per file that isn't string
.
$ ls
one two three four five
$ grep -l 'odd' *
one
three
five
$ grep -lv 'odd' *
one
two
three
four
five
But I want it to print the inverse of the first option
two
four