Macos – Emptying the trash takes “forever”: is using rm -r safe to use in Mac OS X 10.7 (Lion)

macosrmSecuritytrash

Emptying my Trash in Mac OS X 10.7 (Lion) (non securely) is taking about three hours (about 1.5 million files, from a Time Machine backup). I had to stop the process a few times already, because I could not move my laptop with the external harddrive the files are on. This is also a problem because the Trash emptying is restarted from the very beginning each time I empty the Trash again (i.e., files are not deleted when the Trash emptying is aborted).

I read that it is faster to use rm -rf on ~/.Trash, in this case. However, is this safe? (I am afraid that does Mac OS X 10.7 (Lion) performs tasks behind the scenes—which would explain its slowness—that rm -r does not, which could lead to problems in the future.)

Best Answer

It is safe. OS X is probably just detecting the file is in use by some program, or running. If you know you really want it gone, rm it. The next reboot, whatever process was using it will be gone.

BE CAREFUL using rm -r It recursively deletes all subdirectories beneath the directory specified. If you're not familiar with shells, I'd suggest just using rm and explicitly specify files you want deleted (though you said there are lots of files).

Try this: rm -r ~/.Trash/*

That will remove all files and folders within the .Trash folder, without deleting the .Trash folder.