Skip to main content
3 of 4
improved readability
anubhava
  • 790.3k
  • 67
  • 603
  • 671

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.