Raveen Kumar

Grep for files that does not contain a specific string

Another useful way to use grep is for printing file names that do not contain a specific string, for example

grep -L "string" *

You can use the -L option of the grep command, which prints the names of all files that do not contain the specified search string.

The * at the end tells grep to search all files in the current directory. If you want to search only specific files or directories, you can replace the * with the filenames or directory names.

#Linux #Unix #Coreutil #Grep