Reputation: 9
Tried the following command, it lists all the lines including file names
which are not matching the given pattern.
grep -nrv "^type.* = .*"
"But what we need is list of file names in a folder with content
which does not have even a single occurrence of above pattern."
Your help will be really appreciated.
Upvotes: 0
Views: 89
Reputation: 10123
You need the -L
option:
grep -rL '^type.* = .*' directory_name
From the GNU grep
manual:
-L, - -files-without-match
Suppress normal output; instead print the name of each input file from which no output
would normally have been printed. The scanning will stop on the first match.
Upvotes: 1