Elegant delete of word ~tmp files in all sub / dirs

Shantanoo Mahajan shantanoo at gmail.com
Fri Jan 27 09:06:07 PST 2006


+++ Matthew Seaman [freebsd] [26-01-06 20:15 +0000]:
| Graham Bentley wrote:
| > Hi All,
| > 
| > I once found a very elegant method of recursively
| > removing all the word ~tmp files on our Samba
| > server (many hundereds of subs)
| > 
| > It involved find rm xargs and some {}
| > 
| > It worked very quickly indeed. I have tried to
| > find this again but cant and have used alternatives
| > that are alot slower.
| > 
| > Any CLI Gurus point me in the path of enlightenment ?
| 
|    find /your/file-system -type f -name '*~tmp*' -print0 | xargs -0 rm -f
| 
| or something like that.

You may also try:

find /your/file-system -type f -name '*~tmp*' -delete

-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-questions/attachments/20060127/824bfa78/attachment.bin


More information about the freebsd-questions mailing list