Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

salty15

macrumors newbie
Original poster
Sep 13, 2015
10
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.
 
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?
 
Sounds like some kind of permission/ownership problem with the trash...

Try googling this:
"os x trash deletes immediately fix"
 
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.
 
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.
 
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.

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. :(


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.

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 ... :/

Sounds like some kind of permission/ownership problem with the trash...

Try googling this:
"os x trash deletes immediately fix"

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 ...
 
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
 
...
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
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
 
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

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?
 
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/

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.
 
Thanks so much Toutou! This worked and everything is working as it should now. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.