Terminal to delete?

Discussion in 'macOS' started by Michaelgtrusa, Jun 28, 2009.

  1. Michaelgtrusa macrumors 604

    Michaelgtrusa

    Joined:
    Oct 13, 2008
    Location:
    Everywhere And Nowhere
    #1
    I've seen several vids on youtube explaining how to delete using the terminal. The claim, this way will get more hd space back. Has any one used this method?
     
  2. JNB macrumors 604

    JNB

    Joined:
    Oct 7, 2004
    Location:
    In a Hell predominately of my own making
    #2
    You might want to be be little more expansive in your question. What "method" are you talking about?

    To delete something using Terminal, it's just the "rm" command. Not like it's a big mystery or anything. Any space savings using that versus Trash from the GUI are negligible. Both essentially accomplish the same thing.
     
  3. mslide macrumors 6502a

    Joined:
    Sep 17, 2007
    #3
    Might want to provide a link to one of these claims. The only difference, that I'm aware of, between deleting a file from within terminal and from within the OSX GUI is that the former does not put the file in the trash bin... it simply deletes it forever.
     
  4. JNB macrumors 604

    JNB

    Joined:
    Oct 7, 2004
    Location:
    In a Hell predominately of my own making
    #5
    Well, that was painful. :D

    It's still the same thing either way, and the video implies--incorrectly--that the rm command deletes the file, when it in fact does not. It removes the directory entries for files (just like Empty Trash), and "frees up" the same space, even though the original data still resides on the disk. Empty Securely overwrites the filespace and removes the directory entry, but again, does not "delete" data from a drive.

    In fact, if you think about it logically, it's physically impossible to truly delete data--that is, removing it from a drive--once written to for the first time. All you can ever do is continually overwrite the same blocks with something else.
     
  5. mmulin macrumors 6502

    Joined:
    Jun 22, 2006
    #6
    Once you empty the trash bin, there is no difference. I doubt there is a command which magically creates more space when deleting a file xxx bytes in size, wtf.
     
  6. Michaelgtrusa thread starter macrumors 604

    Michaelgtrusa

    Joined:
    Oct 13, 2008
    Location:
    Everywhere And Nowhere
  7. old-wiz macrumors G3

    Joined:
    Mar 26, 2008
    Location:
    West Suburban Boston Ma
    #8
    Not to mention that if you are not careful doing rm from terminal you can delete a lot more than you thought you would. When you enter commands at terminal, you are at the Unix command line, which even people with years of experience at it have been known to muck things up.
     
  8. Michaelgtrusa thread starter macrumors 604

    Michaelgtrusa

    Joined:
    Oct 13, 2008
    Location:
    Everywhere And Nowhere
  9. MacUser2525 macrumors 68000

    MacUser2525

    Joined:
    Mar 17, 2007
    Location:
    Canada
    #10
    Which is why it is a good idea to put.

    Code:
    alias rm="rm -i"
    
    In your ~/.bashrc to have it ask to confirm removing of the individual file(s), then you can always use rm -f some_file(s) to skip the question(s) if your sure what you are doing is correct.
     
  10. miles01110 macrumors Core

    miles01110

    Joined:
    Jul 24, 2006
    Location:
    The Ivory Tower (I'm not coming down)
    #11
    Trash is basically just a front end for "rm." You can recover things deleted via Trash (unless you use Secure Empty Trash) or rm, but it takes special software.
     
  11. Ploki macrumors 68000

    Joined:
    Jan 21, 2008
    #12
    rm -rf /
    ;P this method saves you more space than any other!

    disclaimer: dont try it.. although its suppose to have protection against it, i for one am NOT willing to try it on mine.. :D
     
  12. Michaelgtrusa thread starter macrumors 604

    Michaelgtrusa

    Joined:
    Oct 13, 2008
    Location:
    Everywhere And Nowhere
  13. Nadinengland macrumors newbie

    Joined:
    Jun 14, 2009
    Location:
    Yorkshire, UK
  14. mslide macrumors 6502a

    Joined:
    Sep 17, 2007
    #15
    Of course. My point was that deleting a file in the gui just simply moves it to a folder, in your home directory, called ~/.Trash, instead of removing it like rm does. I wasn't sure if the OP knew that only doing the former (without emptying the trash) doesn't actually recover hard drive space.
     
  15. Michaelgtrusa thread starter macrumors 604

    Michaelgtrusa

    Joined:
    Oct 13, 2008
    Location:
    Everywhere And Nowhere
    #16
    Since i'm not well educated on this method, I will not use it. I'll use cleanapp and then secure delete.
     

Share This Page