On 2015-10-09, Marko Rauhamaa <ma...@pacujo.net> wrote: >>> $ rm $(find . <find-options-go-here>) > > This is not safe since find might return pathnames with spaces in > them.
Good point. > Also, the command fails if find should produce no matches. I just tried, it with a pattern that produced no matches, and it removed no files. That's what one would expect it to do. I admit the message from rm is undesirable. :) >> Or if you're using GNU find: >> >> $ find <find-options-go-here> -delete > > This is safe. Agreed, that is a better answer. I've known for years that gnu find has a -delete option, but I always forget to _use_ it. -- Grant Edwards grant.b.edwards Yow! I'm having a at tax-deductible experience! gmail.com I need an energy crunch!! -- https://mail.python.org/mailman/listinfo/python-list