<html><body>On 20 September 2011 18:58, David Binderman <dcb314@hotmail.com> wrote:<br />> $ find /home/fay -type f -name '*~' -print | grep -v 'whatever pattern you<br />> want' | xargs rm<br />><br />> sounds close to what you want. Even closer might be<br />><br />> $ find /home/fay -type f -name '*~' -print | fgrep -v '/home/fay/.' | xargs<br />> rm<br />><br />> Suggest test it out first, though.<br /><br />> The method I've given, using xargs, can have anything like grep, fgrep,<br />> egrep, sed, perl or<br />> awk after the find, to restrict the list of filenames. Powerful, I find.<br /><br />> I first met Unix 30 years ago - a lot of this regexp technology is even<br />> 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>