How to overcome a “file can’t be deleted” error in OS X

TrashIconXWhen managing files and folders in the Finder, you will undoubtedly need to trash a few here and there; however, when you drag files to the trash you may run into an error where OS X refuses to move them and claims “The item can’t be moved to the Trash because it can’t be deleted,” which is a pretty vague description of the problem at hand, and essentially offers no useful solution.

In general when you do not have permission to remove an item, OS X will indicate this with a permissions-related warning. Alternatively, if the trash structure is damaged, you may run into an issue where OS X will delete items immediately without first placing them in the trash, in which case you may need to rebuild your trash folder structure. However, this current problem is neither of these, but the fix is easy.

If you find yourself encountering this specific error, then the solution is to re-launch your Mac’s Finder, which can be done in several ways.

  1. Reboot your Mac — the most hands-off approach
  2. Log out of your account and log back in — another relatively hands-off approach
  3. Force-quit the Finder — the quickest approach

This last option can be done by pressing Option-Command-Escape (or choosing Force Quit from the Apple menu) and then choosing the Finder from the Force-Quit window and clicking the Relaunch button. Alternatively, you can hold the Option key and right-click the OS X Dock to reveal a “Relaunch” option. Finally, if you are savvy with the OS X Terminal, you can run the following command to re-launch the Finder:

killall Finder

When done, your Finder windows and desktop icons will disappear, and then re-appear after a few moments when the Finder is automatically re-launched.

5 thoughts on “How to overcome a “file can’t be deleted” error in OS X

  1. bowersrob

    or, in Terminal, cd to ~/.Trash and rm -f filename, or rm – rf directoryname.

    -f forces the deletion, -rf recursively forces deletion on everything in the directory.

    But, use this carefully, it is not reversible!

    Reply
  2. MaX

    Useful article. There are also utilities to do it via GUI like Cocktail.
    http://www.macupdate.com/app/mac/10909/cocktail

    Reply
  3. deskrev

    Another option is to use “Secure Empty Trash” This will delete files in use.
    You can see what’s using the file with lsof in the terminal.

    Reply
  4. Paul Bergsagel

    Another very easy method to force quit the finder is while holding down the shift key go to the apple menu and select force-quit finder.

    Reply

Leave a Reply to deskrev Cancel reply