<html><body>On 20 September 2011 18:58, David Binderman &lt;dcb314@hotmail.com&gt; wrote:<br />&gt; $ find /home/fay -type f -name '*~' -print | grep -v 'whatever pattern you<br />&gt; want' | xargs rm<br />&gt;<br />&gt; sounds close to what you want. Even closer might be<br />&gt;<br />&gt; $ find /home/fay -type f -name '*~' -print | fgrep -v '/home/fay/.' | xargs<br />&gt; rm<br />&gt;<br />&gt; Suggest test it out first, though.<br /><br />&gt; The method I've given, using xargs, can have anything like grep, fgrep,<br />&gt; egrep, sed, perl or<br />&gt; awk after the find, to restrict the list of filenames. Powerful, I find.<br /><br />&gt; I first met Unix 30 years ago - a lot of this regexp technology is even<br />&gt; older.<br /><br />Thanks for the tip, David. I like the -type option, which narrows down the search, but I can't get to grips with the xargs today. I looked carefully through the Wikipedia article and also a step-by-step tutorial, but I will need more time.<br /><br />However, re. fgrep, I found this <br /><br />fgrep (grep -F in linux) is fixed or fast grep and behaves as grep but
does not recognise any regular expression metacharacters as being
special.<br /><br />That could be worth looking into when i have the dots and slashes in the path.<br /><br /><br />We haven't seen you at a moot recently ... do look out for the upcoming talks.<br /><br /><br />
                Best Regards,<br />Fay<br />East Grinstead Linux User Group<br />www.eglug.org.uk<br /><br /></body></html>