12

If there are a lot of files in the trash, sometimes the Finder will display a progress bar saying (for example) "Preparing to delete 62,736 files", then another progress bar for the actual deletion. By comparison, deleting those same files from the command line is nearly instantaneous.

What is the Finder doing that takes so long? Is it detrimental to my system to skip that by deleting files via rm?

2
-2

This is a case of "destructive" vs "non-destructive" editing of files. Like in old days of cutting and gluing together audio tape or film, editing then was destructive like RM command is. You type in the command, hit ENTER and RM is immediately executed.

On the other hand, moving files to the TRASH folder is just that, and the system responds, "wait while I figure out how much stuff I need to move". You pay in time for the ability to UNDO a possible accidental erase. In the old days we were usually not so lucky in computers or with film or tape. :-)

3
  • Not sure this is referring to what the question is actually asking—not about moving files to the trash but about emptying the trash. – grg Nov 18 '14 at 21:35
  • Simply put, rm directly removes the file headers from the files and directories marking them as free, and the file data is still on the disk. (The -P flag in rm writes over the data in three passes, effectively wiping it.) A Finder Trash delete, though, has the overhead involved with actually moving the files to the .Trash folder, allowing for duplicate items as well – IconDaemon Nov 18 '14 at 21:38
  • 4
    Yeah, this is about the actual trash emptying, not moving to the trash. @IconDaemon: that sounds more like what I'm looking for, but the .Trash folder is where files live when they're in the trash can, right? What is the Finder doing when I actually empty the trash that takes so much longer than removing the files headers? – Nate Cook Nov 18 '14 at 22:08

Not the answer you're looking for? Browse other questions tagged .