Trash won't empty, rm -R won't work

Discussion in 'macOS' started by idkew, Mar 28, 2006.

  1. idkew macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #1
    I am trying to empty my trash on en external drive.

    I tried cocktail's for empty- no luck

    I tried rm - no luck

    I tried rmdir - no luck

    here is the prompt of what I get in a rm -R

    Code:
    CPU:/Volumes/Platter/.Trashes/1026 name$ rm -r  /Volumes/Platter/.Trashes/1026/*
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02/08: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02/11: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02/12: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02/13: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02/15: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02/28: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/02: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002/03: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2002: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2003/01/30: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2003/01: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h/2003: Directory not empty
    rm: /Volumes/Platter/.Trashes/1026/h: Directory not empty
    any idea what the problem is? it is really annoying.
     
  2. idkew thread starter macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #2
    now i get this when i try to do one file at a time:

    Code:
    CPU:/Volumes/Platter/.Trashes/1026 name$ rm -r  /Volumes/Platter/.Trashes/1026/*
    rm: /Volumes/Platter/.Trashes/1026/IMG_0802.JPG: Invalid argument
     
  3. grapes911 Moderator emeritus

    grapes911

    Joined:
    Jul 28, 2003
    Location:
    Citizens Bank Park
    #3
    Did you try a reboot?

    If that doesn't work, try adding the force argument:
    rm -rf ~/.Trash/*
     
  4. truz macrumors 6502a

    truz

    Joined:
    Jan 1, 2006
    Location:
    Florida
    #4
    su into root and then give the command a try.
     
  5. superwoman macrumors regular

    Joined:
    Apr 25, 2005
    Location:
    Monterey,CA
  6. M-theory macrumors 6502

    M-theory

    Joined:
    Dec 1, 2005
    Location:
    Pittsburgh, PA
    #6
    to the OP, CAUTION: this is a very dangerous command, make sure you have backed up before typing, and make sure you are in the correct directory, once you type it, forget the command and move on...:)
     
  7. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #7
    This is probably NOT the problem, but is something that those not used to unix can often miss.

    Remember that, unlike windows, the shell will expand your * before it executes your command. So say the directory you want to empty contains the following files and folders.

    Code:
    ./.hidden file
    ./.dotdir/1.txt
    ./.dotdir/2.txt
    ./file.jpg
    ./dir/file.doc
    ./dir/file.ppt
    When you run 'sudo rm -rf *' in that directory that expands to 'sudo rm -rf file.jpg dir' but the dotfiles are not matched. The first three files will not be affected by the command. You also generally do not want to run 'sudo rm -rf * .*' since that will generally include '.' and '..' and you probably wanted to keep '..' ;)

    When using rm -rf, it is safest to point it at a single directory at a time.

    i.e. 'sudo rm -rf .'

    B
     
  8. dr_lha macrumors 68000

    Joined:
    Oct 8, 2003
    #8
    Actually the command you need is:

    sudo rm -fr /

    :)






    NOTE: JUST KIDDING - DON'T DO THIS AS YOU WILL WIPE YOUR HARD DRIVE!!!!!
     
  9. M-theory macrumors 6502

    M-theory

    Joined:
    Dec 1, 2005
    Location:
    Pittsburgh, PA
    #9
    thank you for the 'better' answer, your explanation is very clear and helpful.
     
  10. M-theory macrumors 6502

    M-theory

    Joined:
    Dec 1, 2005
    Location:
    Pittsburgh, PA
    #10
    ...then don't post this stuff...not something you want to 'kid' about.
     
  11. balamw Moderator

    balamw

    Staff Member

    Joined:
    Aug 16, 2005
    Location:
    New England
    #11
    Note that I really don't think this is the OP's problem, just one that can often create unnecessary confusion, and it is pertinent since various posters included "*" in their solutions.

    Personally, I like to use variations like "sudo rm `find . -type f -print`" to wipe out all the files in a folder leaving the folder structure intact.

    B
     
  12. dr_lha macrumors 68000

    Joined:
    Oct 8, 2003
    #12
    Spoilsport.
     
  13. M-theory macrumors 6502

    M-theory

    Joined:
    Dec 1, 2005
    Location:
    Pittsburgh, PA
    #13
    Again, excellent point, there are great things gained by having a BSD based OS, but also dangers...and yes, the "*" is dangerous.
     
  14. Togglehead macrumors 6502

    Joined:
    Mar 16, 2006
    Location:
    Jersey
  15. idkew thread starter macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #15
    thanks for the replies.

    I did try sudo prior to my post. no luck there.

    i ran disk utility and found my directory is screwed yet agian. diskwarrior agrees. not fixable.

    i think the hardware striped raid is a ppor implimentation on my external drive (2x250gb)

    i will backup all i can and reformat with a software raid.

    unless there are more ideas.
     
  16. idkew thread starter macrumors 68020

    idkew

    Joined:
    Sep 26, 2001
    Location:
    where the concrete to dirt ratio is better
    #16

    i did try that, i was just trying all options. * was my last.
     

Share This Page