Announcement

Collapse
No announcement yet.

deleting a folder

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    deleting a folder

    Hi there
    I managed to create a folder under /usr/local/bin/ that I am now unable to delete
    (I was attempting to install Firefox incorrectly)
    Even if I log in as sudo su it still returns - rm: cannot remove `firefox': Is a directory

    There is nothing in the folder - I have already removed the contents with no problem
    Presumably it is a permissions thing but beyond my current experience
    The pc has been restarted and still no success
    Thanks
    Neil

    #2
    Re: deleting a folder

    In it's wonderful helpfulness, linux wants to explicitly know you're okay with wiping out a folder and everything underneath it. You have to specify this with '-r' which stands for recursive.

    Code:
    rm -r /path/to/folder
    See if that works.

    Comment


      #3
      Re: deleting a folder

      thanks that worked
      (it is very basic I know)
      why then didn't I have the same problem when I deleted sub-folders
      (I thought if I removed everything from the folder first it might help)

      Comment


        #4
        Re: deleting a folder

        At times, when such happens, I switch to GUI, open Konqueror as root:
        kdesu konqueror
        and manage to delete the stuff.
        When that doesn't work,
        I switch to CLI, Konsole, and try ...



        An intellectual says a simple thing in a hard way. An artist says a hard thing in a simple way. Charles Bukowski

        Comment


          #5
          Re: deleting a folder

          Yeah, using the gui is probably a better route, actually. My first computer was a Commodore Vic20, so I'm used to typing commands. Doing it through the gui would also have the added benefit of putting it in your trash can where you could restore it later.

          I'm not sure why it would allow you to delete some folders but not others, but here is a scenario which would allow it:

          The main folder was created as root with w permissions for users.
          As a user you created the subfolders.
          You, the user, have -r set as default to the rm command, or have rm re-aliased to rm -r $@, for example. This would be done in any number of places and behind the scenes. I'm new to kubuntu, so I can't say for sure.
          Root, however, doesn't have this set. If you're going to wipe out a folder, given the possible consequences, they want you to specify that a folder is indeed what you meant.

          Again, that's just a theory.

          Comment


            #6
            Re: deleting a folder

            nice try.

            However I couldn't delete it with the GUI either. And it didn't come back with a "Are you sure" dialogue box - it simply errored with a message I can't remember but indicated a permissions issue.

            So with the same GUI I could delete the sub-folders but was unable to delete the parent folder even when it was empty.

            And yes I did create the parent folder prior to populating it with files, however it was created as a normal user (not sudo su).

            Anyway just a mystery and until it happens again it matters little.

            Thanks for trying
            Neil

            Comment


              #7
              Re: deleting a folder

              /usr/local/sbin is 'owned' by root. In order to write anything there, it must be done by root (or the user with root privileges).

              rm remove files or directories
              rm -r remove directories and their contents recursively
              rmdir remove empty directories

              If the folder/sub-folders were created in /usr/local/sbin they must have been done so by root or by the user with temporary root privileges.
              Using Kubuntu Linux since March 23, 2007
              "It is a capital mistake to theorize before one has data." - Sherlock Holmes

              Comment

              Working...
              X