Delete files – always 'delete immediately' dialogue

Discussion in 'Mac Basics and Help' started by salty15, Jan 24, 2016.

  1. salty15 macrumors newbie

    Joined:
    Sep 13, 2015
    #1
    Hi there, hope this is the correct place to post this problem!

    I have a iMac 27-inch, mid-2011 running El Capitan 10.11.1.

    A week or so ago, I was unable to delete files from my Trash, so Googled for some way to force delete the items (as you used to be able to in earlier iterations of OSX). I found the following terminal line: sudo rm -rf ~/.Trash /Volumes/*/.Trashes (from here: http://apple.stackexchange.com/questions/209031/how-do-i-force-the-trash-to-empty-on-el-captan). This did the trick, but, ever since, every time I go to delete a file, I get the 'will be deleted immediately' dialogue and the file is indeed deleted immediately, without going into Trash. I am a novice Mac user (as you will probably have gathered!) so don't understand what the Terminal line did that I entered (the place I found it said that its purpose was just to empty the trash – I try to be very careful when running terminal, as I know that it can cause major problems!).

    Any advice on how I can reverse the command and get my deleted files going to my Trash again as normal would be greatly appreciated.
     
  2. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #2
    The commands you have used do empty the trash, but they even delete the trash itself. Your account's trash is located in the ".Trash" folder in your home directory. OS X is supposed to create a new .Trash for you in case you accidentally delete it. Have you tried logging out or restarting the machine since this started happening?
     
  3. Fishrrman macrumors G4

    Joined:
    Feb 20, 2009
    #3
    Sounds like some kind of permission/ownership problem with the trash...

    Try googling this:
    "os x trash deletes immediately fix"
     
  4. nightcap965 macrumors 6502a

    nightcap965

    Joined:
    Feb 11, 2004
    Location:
    Cape Cod
    #4
    Do not do things from the command line unless you have some knowledge of Unix. The MacOS X user interface can protect you from yourself. The command line, not so much.
     
  5. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #5
    Just a note - whatever I do to my .Trash in El Capitan, it always seems to fix itself. As soon as I try to remove a file, new .Trash is created if there isn't any, permissions are repaired if they've been changed.
    I can't find a way to break it intentionally. Hell, even if I screw up my home folder's permissions and change the owner of the .Trash, it changes back automatically.
     
  6. salty15 thread starter macrumors newbie

    Joined:
    Sep 13, 2015
    #6
    I've tried restarting, etc., but to no avail. The problem doesn't seem to want to resolve itself as you say it does on your computer. :(


    Thanks, nightcap; I realise this – I only very rarely go into Terminal – only when I'm really, really stuck and even then I try to make sure that the lines I run will be safe by reading up on them first. However, this one didn't work ... :/

    Thanks Fishrrman – I've already had a look at this side of things, but no luck. I'll have another look of course tho. :)

    Any other suggestions? I'm at a loss ...
     
  7. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #7
    Well, first, open the terminal and run this command:
    Code:
    ls -la | grep Trash
    It should display a line like this:
    Code:
    drwx------    3 toutou  staff    102 25 led 18:48 .Trash
    This means there is a .Trash directory, the permissions are read+write+execute for me, and nothing for anybody else.
    If it doesn't display anything, your .Trash folder isn't there, and for whatever reason OS X is not trying to fix this. You can fix it by running this command:
    Code:
    mkdir .Trash
    ,
    then
    Code:
    sudo chmod 700 .Trash
     
  8. chown33 macrumors 604

    Joined:
    Aug 9, 2009
    #8
    Here's a single command that does what those two do:
    Code:
    mkdir -m 700 .Trash
    Afterwards, run this again, to confirm the result is as expected:
    Code:
    ls -la | grep Trash
     
  9. salty15 thread starter macrumors newbie

    Joined:
    Sep 13, 2015
    #9
    Thanks so much for your help!

    Okay, so when I run 'ls -la | grep Trash', the response I get is: 'drwx------ 2 root staff 68 20 Jan 08:43 .Trash' – does that look right? My user name on the computer is 'Lyne' and the computer is called 'Rose', so wouldn't I expect to see one of those words in the response? Presume this therefore indicates I have a permissions problem instead of a missing Trash?
     
  10. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic
    #10
    Your permissions are fine, it's supposed to be "rwx------", but the .Trash belongs to a wrong user (root). It's supposed to belong to you. Let's make it belong to you:
    Code:
    sudo chown $USER .Trash/
     
  11. salty15 thread starter macrumors newbie

    Joined:
    Sep 13, 2015
    #11
    Awesome, thank you! :) Now when I run 'ls -la | grep Trash' it returns 'drwx------ 2 rose staff 68 20 Jan 08:43 .Trash'. I'll restart and see whether the Trash is now working properly.
     
  12. salty15 thread starter macrumors newbie

    Joined:
    Sep 13, 2015
    #12
    Thanks so much Toutou! This worked and everything is working as it should now. :)
     
  13. Toutou macrumors 6502a

    Toutou

    Joined:
    Jan 6, 2015
    Location:
    Prague, Czech Republic

Share This Page