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

Mathieu CHATEAU gollum123 at free.fr
Fri Jan 27 10:34:49 PST 2006

Hello Olivier,

useless to do -r while you search only files (-type f)

the delete function of find seems more apropriate to me


Friday, January 27, 2006, 3:00:50 AM, you wrote:

>> > > removing all the word ~tmp files on our Samba
>> > > server
>> >
>> >    find /your/file-system -type f -name '*~tmp*' -print0 | xargs -0 rm -f
>> >
>> > or something like that.
>> >
>> find /your/file-system -type f -name '*~tmp*' -delete

ON> Or, Graham wanted something with {}

ON> find /your/file-system -type f -name '*~tmp*' -exec /bin/rm -rf {} \;

ON> Olivier
ON> _______________________________________________
ON> freebsd-questions at freebsd.org mailing list
ON> http://lists.freebsd.org/mailman/listinfo/freebsd-questions
ON> To unsubscribe, send any mail to
ON> "freebsd-questions-unsubscribe at freebsd.org"

More information about the freebsd-questions mailing list