How to find text files not containing text on Linux?

The command you quote, ironically enough does exactly what you describe.
Test it!

echo "hello" > a
echo "bye" > b
grep -iL BYE a b

Says a only.


I think you may be confusing -L and -l

find . -print | xargs grep -iL "somestring"

is the inverse of

find . -print | xargs grep -il "somestring"

By the way, consider

find . -print0 | xargs -0 grep -iL "somestring"

Or even

grep -IRiL "somestring" .

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)