Conversation started Aug 15, 2013 at 14:47.
Aug 15, 2013 14:47
Why does rm -r *.*~ doesn't work as expected?
Files in subfolders aren't gettin deleted
@ThatBrazilianGuy there is no way to tell the rm command to delete files matching a certain wildcard/glob in all subfolders; you have to use a looping command or find
Bob
Bob
That was a slightly weird thing to star.
Oh, don't unstar it! :P
use find with -delete and cry a river
you can tell it to delete actual folders (and all their subfolders) or actual files in the current directory or in any directory you specify, but it won't "recurse" into subfolders and apply the same globbing pattern in those folders
Bob
Bob
@jokerdino Better print first to make sure you don't wipe everything.
Aug 15, 2013 14:51
i would suggest you use find and then xargs rm things
yeah, always do a print or echo or similar command whenever you have some kind of recursing delete script
lesson learned the hard way -_-
@Bob once upon a time, i used find with -delete as the very first parameter. I learnt my lesson.
the damn thing deleted my home folder
Bob
Bob
ouch
 
Conversation ended Aug 15, 2013 at 14:52.