PDA

View Full Version : grep



Jamwa
26th May 2008, 05:05 PM
Hi all.

If I do

locate <file_name> | grep <filter_string>

I will get all files that have <filter_string> in their name.

What if I want files that do NOT contain <filter_string> in their name. How do I do that?

Thanks in advance

stevea
26th May 2008, 05:22 PM
grep -v <filter_string>

Also note that locate takes basic regular expressions, not just filnames.

Jamwa
26th May 2008, 05:33 PM
Thanks for that and for the info too. Noted with interest