1 2 Previous Next 15 Replies Latest reply: Jul 12, 2014 9:57 AM by venetsanos
xparrot Level 2 Level 2 (205 points)

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)
  • 1. Re: Empty Trash Through Terminal
    macjack Level 9 Level 9 (50,510 points)

    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.

  • 2. Re: Empty Trash Through Terminal
    Axeman1020 Level 6 Level 6 (13,235 points)

    Copy and paste the following into Terminal:

     

    sudo rm -rf ~/.Trash/*

  • 3. Re: Empty Trash Through Terminal
    xparrot Level 2 Level 2 (205 points)

    Axeman1020, it asked for my admin password which I entered. It did not delete the files.

  • 4. Re: Empty Trash Through Terminal
    xparrot Level 2 Level 2 (205 points)

    MacJack,

     

    That worked for my other problem which was having to enter a password when I drag something to the Trash, but my empty folders still exist. The folders were from an external drive.

  • 5. Re: Empty Trash Through Terminal
    macjack Level 9 Level 9 (50,510 points)

    Connect the external and delete them.

    This is because it's not in Trash, it's in Trash on the external volume. If it's from a Windows partition boot from that and run Chkdsk.

  • 6. Re: Empty Trash Through Terminal
    roadrunnersrg Level 1 Level 1 (10 points)

    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

  • 7. Re: Empty Trash Through Terminal
    thomas_r. Level 7 Level 7 (27,960 points)

    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.

  • 8. Re: Empty Trash Through Terminal
    xparrot Level 2 Level 2 (205 points)

    Folders are not from a Time Machine volume. Is it possible they were trashed by another login admin?

  • 9. Re: Empty Trash Through Terminal
    Eric Root Level 6 Level 6 (16,210 points)

    Information.

     

    Trash – Can’t Empty or Move File To Trash

     

    Trash FAQ          

  • 10. Re: Empty Trash Through Terminal
    Devecseri Level 1 Level 1 (0 points)

    echo PASSWORD | sudo -S rm -rf ~/.Trash/*

     

     

    whenever you want to pass your password to a command you gotta do this ^

  • 11. Re: Empty Trash Through Terminal
    thomas_r. Level 7 Level 7 (27,960 points)

    That is not true at all! In fact, this is extremely insecure, as it would leave a plaintext copy of your password lingering in the Unix command history file indefinitely. It is not necessary to echo your password to use a "sudo" command.

  • 12. Re: Empty Trash Through Terminal
    venetsanos Level 1 Level 1 (0 points)

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

  • 13. Re: Empty Trash Through Terminal
    tbirdvet Level 4 Level 4 (1,230 points)

    You are correct.  Never delete TM backups as you would normal files.

  • 14. Re: Empty Trash Through Terminal
    Axeman1020 Level 6 Level 6 (13,235 points)

    I am glad you got it sorted out.

     

    New to Mac?

    You may find these useful:

    Mac Basics

    Mac OS X: PC to Mac

    PC to Mac Guide - OS X Tips, Tricks & Tutorials

1 2 Previous Next