How to delete locked files from the trash

About

I deleted old Time Machine backups that had OS protected files that would not allow me to completely empty the trash. Several forums pointed me to command line tricks but it was actually much simpler. As usual on the Mac, it is only intuitive once you know the answer.

  1. Double click the trash to open it
  2. Hold down the option key and press empty.

That's it. It will now remove secure, protected files from the trash. I guess Apple is thinking "By pressing Option, you are making a MORE conscious act emptying the trash."

Here is a screenshot - notice the locked file (boot.efi) has a lock icon. You can not easily unlock this file. Just hold "option" key and press "empty" in the top right.

A few other notes on this topic:

  • I deleted over 15,000,000 files (990GB) off an external drive (old backups). They go to the trash in 5 seconds, but to empty the trash... Finder took about 30 mins just to prepare to delete and counted 10M files, but when it deleted them it counted down to zero then kept going to negative 5 million. It took a long time, almost 3 hours, but it finally finished leaving just 89 files in the trash (the locked ones that I had to "option" + empty).
  • If you click on the trash icon and hold a menu comes up, press "command" and you see "secure empty" this will not remove locked files. Instead this deletes and writes over the files so they can not be recovered.