Emptying trash on Mac is quite troublesome at times, because some files are locked.
Is there an easy way to force empty without going to the terminal typing the rm command?
As others have mentioned, you can hold down the option key (⌥) while choosing Empty Trash to ignore locked files. But if they're actually in use, you have a few options:
- Figure out which applications are using the files with
lsof | grep in_use_filename), and quit those applications
- Use the
rmcommand to delete
- Choose "Secure Empty Trash…" from the Finder menu. If you have a lot of files, this will take a while, since it actually overwrites the contents before deleting... but if you don't, it's an easy way to ignore the purportedly in-use files and delete them anyway.
Oh, I found a very easy way to do this.
- Hold down the Option key and click on the trash bin
- Release the click (still have option key pressed)
- Click on "Empty Trash" (still have option key pressed)
Hm.. hidden feature of Mac.
Forcing-deleting a locked file can sometimes cause issues - you may be deleting a file that is actually in use, possibly by the system. Logging out and back in again will usually cause the locking process to release the files, allowing normal deletion. E.g.: I periodically trash everything in my user, and the system's, caches. Some of them are locked and that's how I unlock them.