OS X: Files Skipping Trash And Deleting Immediately

Published on April 28, 2011, by in osx.




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!


Related posts:

  1. .3gp Video Files and OS X

4 Responses

  1. Mike Wach

    Hi,

    When I tried step 3 above, Terminal said:

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

    Now what?

  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.

    • 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

  3. cata

    it worked – THANK YOU!!!

Leave a Reply

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

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

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

Home osx OS X: Files Skipping Trash And Deleting Immediately
© Copyleft scottlinux.com CC BY-SA 3.0