Force emptying trash inc external HDD with locked files

Discussion in 'Mac Basics and Help' started by iTweed, Jun 22, 2016.

  1. iTweed macrumors newbie

    Joined:
    May 27, 2013
    #1
    Hi

    I have a 1TB external HDD. I moved 2 years' worth of backups to trash, and trash takes too long to load files to delete them.

    So I researched and used this command: "sudo rm -rf ~/.Trash/*" and entered my password.

    It came back "illegal operation"

    So I figured maybe there are locked files in there.

    I researched and used the unlock command chflags -R nouchg [dir_to_unlock].

    Tested successfully on a test folder on the desktop.

    I want to try it on the external HDD, possibly all files, but - and this is n00b - I can't figure out what my external HDD's address is in Finder. I typed the name of it and nothing.

    Help?
     
  2. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #2
    Just open terminal and drag the icon of your external drive from Finder into the terminal window. It will automatically create the path.
     
  3. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #3
    http://nonamescriptware.com

    Try using TrashIt. Might be easier for you than trying to do it from the command line.

    The path to the external would be /Volumes/DriveName where DriveName is the external volume name.
     
  4. s0nicpr0s macrumors regular

    s0nicpr0s

    Joined:
    Sep 1, 2010
    Location:
    Illinois
    #4
    I'd recommend verifying that there is nothing left in the trash that you may have accidentally included. But if you want to force empty all trash bins you can use this command.

    sudo rm -rf ~/.Trash/* /Volumes/*/.Trashes

    This will first empty your local trash, and then go through and empty the trashes on all other attached drives.
     
  5. steve23094 macrumors 68000

    steve23094

    Joined:
    Apr 23, 2013
    #5
    So I have tried all the suggestions here and just cannot get rid of a folder in my Trash. I have no idea why it has ended up with all these embedded folders, it must be some sort of glitch. When I try the terminal commands I get 'file name is too long'. Anybody got another idea?

    Screen Shot 2016-10-28 at 02.05.52.png
     
  6. Weaselboy Moderator

    Weaselboy

    Staff Member

    Joined:
    Jan 23, 2005
    Location:
    California
    #6
    See that little cloud to the right of some of the files at the bottom? I think that is from having iCloud Drive's Documents and Desktop sync on and I wonder if that is holding things up. Try going into iCloud settings and turning that off then empty trash.
     
  7. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #7
    Open Disk Utility and run Repair Disk on your external drive. Run it twice, once while clicked on the line with the name of the brand of the hard drive, and once click on the line below with the name of the external hard drive.
     
  8. steve23094 macrumors 68000

    steve23094

    Joined:
    Apr 23, 2013
    #8
    You were right. Logging out of iCloud seemed to take care of it.

    Cheers.
     

Share This Page