Want to highlight a helpful answer? Upvote!

Did someone help you, or did an answer or User Tip resolve your issue? Upvote by selecting the upvote arrow. Your feedback helps others! Learn more about when to upvote >

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Empty Trash Through Terminal

I have some old empty folders in my trashcan that I cannot delete. I have tried going to the terminal and typing:


rm -rf ~/.Trash/*


But it then gives me a "Permission denied". I am a Terminal novice, and barely that. I'm not sure if this is tied to Mavericks and how I now have to put in a admin password when dragging things to the trash. Very annoying, I would love to shut that off.

8-Core MacPro, Mac OS X (10.7.2)

Posted on Nov 8, 2013 8:01 AM

Reply
17 replies

Nov 8, 2013 8:04 AM in response to xparrot

Coud these items be from an external drive?


YOu need to use sudo for that coomand but first try deleting from the external.


For the permissions issue try this...

Choose your Home folder "Get Info" (command-i) and be sure you have "read & write" in the Sharing & Permissions section. Check under "General" section to be sure it isn't locked. If that is correct, launch Applications/Utilities/Terminal and at the prompt copy & paste this command…

mkdir ~/.Trash

Press return.

If you get a message that the folder already exists, copy & paste these commands...

sudo chown $UID ~/ .Trash

Press return.

Enter your admin password (it will be invisible)

Press return.Then enter

chmod u+rwx ~/.Trash

Press return. Log out and back in, or restart.

Nov 8, 2013 8:24 AM in response to xparrot

It doesn't sound like you quite own all of your home drive items (and you should). This would be causing your trash difficulty as well.


You can change this graphically, if you aren't big on messing with command line things:


-Select your Home folder inside the Users folder

-Get Info from the File Menu

-Make sure your login is chosen as the owner and that it has Read and Write

-In the gearbox at the bottom of the Get Info dialog choose "Apply to Enclosed"


The second and third entries are usually Group and Other and they generally only need Read to this location

Nov 8, 2013 8:23 AM in response to xparrot

The folders were from an external drive.


Is there any chance that external drive is a Time Machine backup? If so, you may very well have damaged your backups, and if using sudo rm doesn't remove those items, you may have to resort to erasing that external drive completely and starting your backups over from scratch.


If it's not a Time Machine backup, I would defer to what has already been said.

Jul 12, 2014 12:02 AM in response to Axeman1020

Hello.its my first post in apple support forum and i wanted to say that the sudo command solved my problem too.

i had moved a back up of time machine file to the trash (i have an external hard disk) and i couldnt deleted.i used the sudo command and was deleted.nothing else worked.when i entered the password it was blank at the terminal and i assumed that i was doing something wrong.but then i read that this is a normal situation.

thanks again.

ps:its my first macbook and just trying to keep up with differences.

ps2:i reformatted the external drive and took a clean time machine back up.

conclusion:time machine files MUST NOT be deleted with drag n drop on trash can.just through the time machine menu (star wars...)

Empty Trash Through Terminal

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.