OS X: Files Skipping Trash And Deleting Immediately

By | 2011/04/28

You may have seen this in OS X when trying to delete files:

“This item will be deleted immediately. You can’t undo this action.”

item_will_be_deleted

Deleting and recreating the .Trash directory will generally solve this.

Here’s a quick guide!


1. Crack open a terminal:

Applications > Utilities > Terminal

osx_terminal


2. Next, remove the existing Trash directory if it exists by typing the command as below into the terminal.
Your command prompt may complain of no such file or directory. That’s ok.

$ rmdir -rf ~/.Trash
rmdir: .Trash: No such file or directory

If your trash is not able to be emptied or deleted, you can preface this command with sudo. Take extreme caution in using sudo. You will be prompted for your password:

$ sudo rm -rf ~/.Trash

3. Now, create the directory call .Trash. It needs the ‘dot’ as well as a capital T as below:

$ mkdir ~/.Trash

4. Finally, restart Finder:

Apple Menu > Force Quit > Relaunch Finder

relaunch_finder

Now your trash should work fine!

8 thoughts on “OS X: Files Skipping Trash And Deleting Immediately

  1. Mike Wach

    Hi,

    When I tried step 3 above, Terminal said:

    mkdir: /Users/mike/.Trash: Permission denied

    Now what?

    Reply
  2. Mike Wach

    Now I’m asked for a password each time I tried to put a file in the Trash, and when I enter my password, trash empties immediately.

    Reply
    1. Marc

      It can also happen, that your trash has the ‘immmutable’ or ‘append’ flag set. You can check this by typing: ls -lOa ~/.Trash. If there are filesystem flags set, remove them (check the respective manpage: man chflags)

      Generally, your ~/.Trash should be owned by you, have permission 700 and no append or immutable flags set:

      chown ~/.Trash
      chgrp staff ~/.Trash
      chmod 700 ~/.Trash (which is: rwx——)

      Marc

      Reply
  3. nicholas

    Heys, after I type in the first command I get:
    rmdir: illegal option — r
    usage: rmdir [-p] directory …
    when I type in the second command: sudo rm -rf ~/.Trash it brings me back to the start…

    Reply
  4. Pivo Kaiser

    Bingo – many thanks, much appreciated!

    Reply
  5. Geggsy

    Still not solved my problem and I get this:

    Mac:~ imac-name$ $ rmdir -rf ~/.Trash
    -bash: $: command not found
    iMac:~ imac-name$ $ sudo rm -rf ~/.Trash
    -bash: $: command not found
    iMac:~ imac-name$ ls -lOa ~/.Trash
    -rw-r–r– 1 imac-name staff – 12801 19 Dec 08:09 /Users/geraint/.Trash

    Reply
  6. Jennifer Goetz

    I tried what you said and it works for one time only then reverts back to the original info in the terminal. I have a mac sierra.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *

Notify me of followup comments via e-mail. You can also subscribe without commenting.