I have a directory with lot of subdirectories in Linux.
Each subdirectories contains a file called variables_list.txt
Now in each variables_list.txt file I want to check if a string is present or not.
For example:
if the string is like below
export host_name=
I want to find out all the subdirectories where in the variables_list.txt file the string is not present.
I tried like below
grep -r -l "export host_name=" .
This is printing all the file names where the string is present.
I tried like below as well
grep -Hrn "export host_name="
This also prints all the file names where the string is present with the line number
I can I achieve what I want