Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Another option' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Another option
Authored by: escowles on Jul 19, '12 08:28:36AM
As several others have noted, you can just delete the parent folder. If you don't want to do that, for example if you just want to delete some of the files or move them somewhere else, you can also use head to limit the number you work with at one time.

For example, you can remove 1000 files at a time:

rm `ls | head -1000`

or remove just the JPG files:

rm `ls | grep -i jpg | head -1000`

[ Reply to This | # ]
Another option
Authored by: karstenw on Jul 19, '12 08:42:18AM

Sorry, but you can't just delete the parent folder if it contains millions of files. I watched the Finder counting for three days, preparing to delete 12 million files in one folder and when the count exceeded the number of files on the volume I killed it.



[ Reply to This | # ]
Another option
Authored by: fracai on Jul 19, '12 06:55:46PM
The Finder is a bit different from the command line though. For one, you don't hear many people chanting "Fix the *censored*ing Command Line" The comments, for example, on the link that you posted seem to indicate that rm can handle recursively removing large numbers of files.

I replicated the example from the comments:

$ mkdir large

$ time for i in {0..999999} ; do echo > large/$i ; done
real	6m41.485s
user	0m36.963s
sys	2m28.405s

$ time rm -r large
real	3m21.800s
user	0m3.100s
sys	2m9.808s

Worked fine for me.
---
i am jack's amusing sig file


[ Reply to This | # ]