A common problem on a mac is not being able to empty the trash because the files are locked. You get a nasty error message “The operation cannot be completed because the file is locked.” The first thing you should do is check to see the file is open in any of your running applications, close it, and try again. If this doesn’t help than it may be locked due to some file permissions issues. Here is what to do:
This method will require you to enter some simple commands into the Terminal. The command is used to permanently delete files on your computer, so please be careful.
Step 1: Open terminal. It’s in your Applications > Utilities folder, or you can quickly bring it up through Spotlight search on the top right of the menu bar.
Step 2: In the terminal type in:
sudo rm -rf
followed by a space.
Step 3: Open trash, and drag over your locked file onto the Terminal window. It should look like this:
Make sure you’ve selected the correct file. Hit Enter on your keyboard, and you will be prompted for your account password. Input your password, hit the Enter key again, and you’re done! Check the trash to see the file is gone.