It's my first time: should I root?

Posted:
in Genius Bar edited January 2014
I had to do an archive and install after some very scary weirdness two days ago. My machine hung on 'Waiting for netinfo' booting up; I couldn't boot from CD at all and starting up from an external hard drive in OS9 my own lovely hard drive wouldn't show up anywhere. It was very strange and I was very worried.



Anyways.



It's sorted now, but I have a Previous Systems folder with nearly a gigabyte of old system files and applications. They're all owned by root so I can't get rid of them.



Is there anything stopping me from logging in as root and putting them in the trash?



What's the best thing to do here?

Comments

  • Reply 1 of 16
    cubedudecubedude Posts: 1,556member
    Don't log in as root. That can be dangerous.



    You can try Pseudo from Brian Hill.



    http://personalpages.tds.net/~brian_hill/pseudo.html



    Or you can go the more complicated route with the "sudo" command in the Terminal. Ask if you want instructions.
  • Reply 2 of 16
    der kopfder kopf Posts: 2,275member
    Quote:

    Originally posted by CubeDude

    Or you can go the more complicated route with the "sudo" command in the Terminal. Ask if you want instructions.



    Which is actually not that hard at all. All you do is open the terminal, type



    Code:


    sudo rm -dfr







    and then (before pressing enter) drop the folder on the Terminal window (don't you just love drag 'n drop shell windows?) with all the old system files you wish to delete, THEN press enter.
  • Reply 3 of 16
    cubedudecubedude Posts: 1,556member
    Hey, I didn't know that one. I always used:



    Code:


    sudo

    rm /FolderToRemove







    And then Ctrl-D twice to logout.
  • Reply 4 of 16
    aquafireaquafire Posts: 2,758member
    Quote:

    Originally posted by CubeDude

    Hey, I didn't know that one. I always used:



    Code:


    sudo

    rm /FolderToRemove







    And then Ctrl-D twice to logout.



    Yep, there's always something new I can learn.. thanx
  • Reply 5 of 16
    der kopfder kopf Posts: 2,275member
    Quote:

    Originally posted by CubeDude

    Hey, I didn't know that one. I always used:



    Code:


    sudo

    rm /FolderToRemove







    And then Ctrl-D twice to logout.



    I don't think that would work, to be honest. You're bound to get an error stating "xxx is a directory", with an occasional "xxx is not empty" to top that of. The way I see it, rm removes files, and although directories are considered files in Unix, it will not remove them willingly. That's were the -dfr comes in. d: attempt to remove directories as well as files. r: attempt to remove the hierarchy rooted in a directories. f: do not prompt for confirmation (f is not strictly necessary).
  • Reply 6 of 16
    Cube and Kopf, thanks.



    I tried the sudo and it won't work. I get this:



    rm: illegal option -- /

    usage: rm [-f | -i] [-dPRrvW] file ...

    unlink file



    Who knows why.



    I'm going to download that shareware tool and if it does the trick he earns his $15.
  • Reply 7 of 16
    Pseudo seems to be no help to me at all. As far as I can tell, it's a tool for opening applications as an administrator. Unless I'm very stupid indeed.



    What can I do? Where might I be going wrong with this sudo business from terminal?
  • Reply 8 of 16
    chychchych Posts: 860member
    You probably forgot a space...

    do this:



    In terminal, type in

    sudo rm -drf



    put a space after the -drf



    drag the folder onto the terminal window, enter, and authenticate, should delete stuff.
  • Reply 9 of 16
    thuh freakthuh freak Posts: 2,664member
    Quote:

    Originally posted by Hassan i Sabbah

    Cube and Kopf, thanks.



    I tried the sudo and it won't work. I get this:



    rm: illegal option -- /

    usage: rm [-f | -i] [-dPRrvW] file ...

    unlink file





    it seems like you misspelled the folder name to remove. Also, use extreme caution with 'sudo' especially when using it and 'rm'. sudo gives you super-user control over the computer, and accidentally mistyping the wrong folder can result in an unbootable computer. so, check your rm line several times before hitting enter. as for the shareware prog, i haven't tried it, so i dont know.



    one thing you can do which is less dangerous, is change the owner of the offending folder (and subs/files), then use the finder to delete it. to do this you go into terminal, and type:

    sudo chown -R <your user name goes here> <full Path to offending folder>



    you can use der Kopf's drag and drop trick to get the folder's path. So you actually type 'sudo chown -R userName ' then drag the folder onto the terminal window. you should notice its full path written into that window (probably with some seemingly strange slashes; they help the shell program deal with any spaces or other difficult characters in the filename). i should also note that the user name you type has to be your short username, not the full name. You can find that out by typing 'echo $USER'. after dropping the folder, check the path, make sure it seems correct (and not something important, like '/' or '/System'), check it again, then hit enter. if you dont get an error message, close terminal and go to the finder. From there you should be able to move the folder into the trash and then empty the trash.
  • Reply 10 of 16
    Quote:

    Originally posted by chych

    You probably forgot a space...

    do this:



    In terminal, type in

    sudo rm -drf



    put a space after the -drf



    drag the folder onto the terminal window, enter, and authenticate, should delete stuff.




    That's it.



    Thanks a million everyone. That's my archive de-archived.
  • Reply 11 of 16
    cubedudecubedude Posts: 1,556member
    BTW, sudo stands for "super user do", I think.
  • Reply 12 of 16
    chychchych Posts: 860member
    Speaking of rm, why do you need a d when you have an r in the options?
  • Reply 13 of 16
    123123 Posts: 278member
    Quote:

    Originally posted by chych

    Speaking of rm, why do you need a d when you have an r in the options?



    You don't, -r implies -d.



    sudo rm -rf PATH_TO_FOLDER





    You never need the -d flag (all you can do with that is deleting empty directories)
  • Reply 14 of 16
    or you could just log in as "root", delete what you want (just be sure its garbage) and then log back into your normal name .... very simple, very easy.
  • Reply 15 of 16
    chychchych Posts: 860member
    Of course, that would require that the root account is enabled... disabled by default, and not really needed.
  • Reply 16 of 16
    der kopfder kopf Posts: 2,275member
    Quote:

    Originally posted by chych

    Speaking of rm, why do you need a d when you have an r in the options?



    That's my way of thanking whoever came up with that modifier



    I have to say that I didn't know it wasn't necessary. I just skimmed through the man page one time, long ago, and took all the flags I thought I'd need.
Sign In or Register to comment.