
You should quote the *.bak to stop the * being expanded by the shell If you're sure you want to remove ALL .bak files without confirmation, pipe the output to xargs find . -name "*.bak" -print | xargs rm -f Alternatively to confirm each deletion, you could use a simple for loop for f in $(find . -name "*.bak" -print) do rm -i $f done -----Original Message----- From: Paul Hampton [mailto:paul.hampton@surfeu.com] Sent: Wednesday, September 06, 2000 4:06 PM To: suse-linux-e@suse.com Subject: [SLE] simple question Hi all Sorry for the simple question, I want to remove all files ending in .bak I can find these using find . -name *.bak Now whats the easiest and safest way to delete them? I ask only because I don't want to delete anything I need ;) Many thanks Paul -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq

Graham Paul tapped away at the keyboard with:
You should quote the *.bak to stop the * being expanded by the shell
If you're sure you want to remove ALL .bak files without confirmation, pipe the output to xargs
find . -name "*.bak" -print | xargs rm -f
Although that's efficient, it's not entirely secure, especially when you have spaces in filenames. find . -name \*.bak -type f -exec rm -f {} \; will do the job safely. -- Bernd Felsche - Innovative Reckoning Perth, Western Australia -- To unsubscribe send e-mail to suse-linux-e-unsubscribe@suse.com For additional commands send e-mail to suse-linux-e-help@suse.com Also check the FAQ at http://www.suse.com/support/faq
participants (2)
-
bernie@innovative.iinet.net.au
-
GPaul@Armature.com