Skip to main content

GREP to show files WITH text and WITHOUT text

I am trying to search for files with specific text but excluding a certain text and showing only the files.

Here is my code:

grep -v "TEXT1" *.* | grep -ils "ABC2"

However, it returns: (standard input)

Please suggest. Thanks a lot.