Guides Mac Tips

How To Get Rid of Locked Files to Empty the Trash

I cannot empty my Trash in Mac OS X. When I try to do an Empty Trash or Secure Empty Trash, it says, “The operation can’t be completed because an unexpected error occurred (error code -8003).” 
This error is generally due to locked files that you’re trying to delete. One surefire way to empty the Trash is to open the Terminal (located in /Applications/Utilities), type the following command, then press Return: 
sudo rm –rf ~/.Trash
You’ll be prompted for your administrator password, and then the Trash will be forcibly emptied. After logging out and back into your account, the Trash should begin working just as before.
This command will force Mac OS X to empty the Trash in your user account.