[NTLUG:Discuss] Find Files NOT containting 'string'
Stuart Johnston
sjohnston at vaultranet.com
Thu Nov 6 19:01:54 CST 2003
I need to search for files that contain one string but not another. Can
anyone suggest a linux command to do this?
The first part is easy with grep but since grep is line based it doesn't
work will for the second part since pretty much every file will have at
least one line that does not contain the string.
I guess one way would be to grep a list of files containing the second
string and compare it against the list of files that contain the first
but I can't think how to easily XOR the two lists of files. I don't
want to ask you to 'do my homework' for me but if you can pull a command
of the top of your head, I would appreciate it.
thanks,
Stuart Johnston
More information about the Discuss
mailing list