How can Finder empty Trash more quickly than "rm -rf /Volumes/Foo/.Trashes/501/*"?
The time it takes to delete a file doesn't depend (much) on the size of the file. Thus, the number of files being deleted matters much more than the size of the files. My guess is that the trash on FooDrive had lots of small files, and that's what took so long.
I just ran a quick test on my HD, with 500,000 zero-length files scattered through 1,110 directories (10 top-level directories, each containing 10 subdirectories, each containing 10 subdirectories, each containing 50 empty files). du -ch
gave their total size as 0B, but find /path/to/trash -mindepth 1 | wc -l
counted 501110 items. Deleting them with rm -R
took 75 seconds, while the Finder took 91 seconds. The difference was mostly that the Finder took 18 seconds "preparing" (i.e. counting the files) before actually deleting them.
Verdict: rm -R
is slightly faster, but not enough to matter. Oh, and the Finder waited until all items were actually gone before playing its crinkle sound.
BTW, for some types of files (e.g. applications), the Finder will show them as single files, but they're actually a hidden folder structure that can contain a large number of files. Use find /path/to/folder -mindepth 1 | wc -l
to get an accurate count of items.