Deleting with terminal

Discussion in 'Mac Help/Tips' started by Haberdasher, Jun 30, 2003.

  1. Haberdasher macrumors regular

    Joined:
    Jul 24, 2002
    Location:
    Los Angeles, CA
    #1
    How can you use the terminal or the inner workings of MacOSX to force delete files? I have two files which I know are no longer in use, after multiple reboots, but one of them , a failed IE download, will not move to the trash despite repeated attempts, since it seems to think it is in use.

    Another is a small application which cannot delete because it is also "in use". Clearly this is not the case.

    Can someone help me and tell me how you can force the deletion of these items? Thanks.
     
  2. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #2
    use the 'cd' command to find the file
    in the terminal you will start in your home directory. to move somewhere else on the hard drive, such as the applications folder, type 'cd /applications'.
    use the 'ls' command to see each folder's content.
    as an example, i created a folder called "deleteme" with a document inside called "document.rtf"

    note: 'Shannon' is the name of my computer, yours will be whatever your computer is named. 'myaccount' will be your account name. type every command after the % sign.

    so now i will type the following
    terminal will return:
    to delete the document, i type the 'rm' command for "remove"
    you can double check to make sure the item was deleted by typing 'ls'. if the file will not remove because you don't have permission, you will need to type the following as a sudo root user: this will ask for your administrator password immediately following the command:
    to remove that 'deleteme' directory, you need to use the 'rmdir' (remove directory) command. but first we need to move back one folder using 'cd ..'
    now i want to use the 'rmdir' command:
    hope this works for you, but be careful with what you delete.
     
  3. Haberdasher thread starter macrumors regular

    Joined:
    Jul 24, 2002
    Location:
    Los Angeles, CA
    #3
    Ha! Excellent! Worked exactly as you said. Now you've got me all interested in Terminal stuff...are there any free FAQs where I can learn more about basic terminal commands such as the ones you've described?

    Oh, and thanks a lot! :D
     
  4. mnkeybsness macrumors 68030

    mnkeybsness

    Joined:
    Jun 25, 2001
    Location:
    Moneyapolis, Minnesota
    #4
    this is a very basic unix tutorial from the university of minnesota computer science department: here

    i don't know of anymore...perhaps try searching google for a while. most people really start learning languages like this by just playing around and messing with stuff. just remember to be careful with what you mess with.
     
  5. tpjunkie macrumors 65816

    tpjunkie

    Joined:
    Nov 24, 2002
    Location:
    NYC
    #5
    For anyone interested that doesn't like to mess around in terminal, you can boot up in os 9, and easily delete those pesky incompleted IE downloads...i figured that out when it happened to me, that was my last resort before going to the terminal
     
  6. Dale Sorel macrumors 6502a

    Dale Sorel

    Joined:
    Jan 12, 2003
    #6
    Here's a good place to start: http://www.osxfaq.com/Tutorials/LearningCenter/
     

Share This Page