how to get rid of a file (with Terminal)

zozo
Posted:
in Genius Bar edited January 2014
I have a file/folder that seems to be impossible to kill.



Im a basically total UNIX newbie and tried the rm command but it said it was a directory and didnt do anything.



When I do an ls -al command, it shows that the read write rights are drwxrwxrwt



what the hell is that? Is that root?



I have no clue where this directory came from and its on my desktop now and I cant throw it away.



I remember somewhere there was a command to do things as a super user...



what do I write? grrrr....



ps, while Im at it, whats the command to rename a file? For example I want to make a file invisible and want to add the '.' in front of it.



thanks

Comments

  • Reply 1 of 4
    eugeneeugene Posts: 8,254member
    If it's a directory you need to use "rm -r"



    -r = recursive.



    drwxrwxrwt means...



    d = directory

    1st r = owner readable

    1st w = owner writeable

    1st x = owner executable

    2nd r = group readable

    2nd w = group writeable

    2nd x = group executable

    3rd r = other readable

    3rd w = other writeable

    t = sticky bit set.



    When the sticky bit is set, then you can place a file in the directory and do whatever you want with it, but you won't be able to mess with other files in the directory unless you are the owner or group owner of the directory. It's kind of like a drop box feature, except it allows anybody to go inside it and rummage around. "tmp" directories in UNIXes typically have the sticky bit on.



    As for renaming a file, just type "mv <old-name> <new-name>"



    [ 06-19-2002: Message edited by: Eugene ]</p>
  • Reply 2 of 4
    zozo Posts: 3,117member
    override rwx------ root/staff for xoxoxox/0? y

    rm: xoxoxox/0: Permission denied

    rm: xoxoxox: Directory not empty





    Hmmm... now what? Im probably gonna boot into OS 9 and then get rid of this damn thing
  • Reply 3 of 4
    thuh freakthuh freak Posts: 2,664member
    actually, to get rid of an empty directory, you use "rmdir &lt;foldername&gt;". But, for some of these shyts, you gotta have the right permissions, so if its given u trouble, just "su" to root (you can also do "sudo -s"). it'll ask 4 ur pass, and then ur god so it can't giv u permission probs. sometimes when u try to get rid of a directory, it'll say its full, so u gotta do "rm -rf &lt;foldername&gt;". bytheby, if you know a command and aren't sure how to use it, you can "man &lt;cmdname&gt;", ex: "man rm". it'll print up a manual page explaining all the minutia and details of the cmd. if you "man chmod", it'll explain all the different permission possibilities.
  • Reply 4 of 4
    zozo Posts: 3,117member
    excellent.. thanks



    it was indeed 'full' and owned by root, so I sudo to root and killed it.



    Thanks again,



    btw, what are the .FBC folders? can I kill those?
Sign In or Register to comment.