Results 1 to 10 of 10

Thread: rm command not working for me.

  1. #1
    Join Date
    Apr 2008
    Location
    Midwest usa
    Beans
    378
    Distro
    Ubuntu 10.04 Lucid Lynx

    rm command not working for me. [SOLVED] :)

    I ran a java uninstaller to remove opencascade but it didn't get every thing.. So I'm going in a blowing away whats left but for some reason there are some things that just wont go....

    For example:
    Code:
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial/src$ ls -a
    .  ..
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial/src$ cd ..
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial$ ls
    src
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial$ rm src
    rm: cannot remove `src': Permission denied
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial$ sudo rm src
    rm: cannot remove `src': Is a directory
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial$ ls -l
    total 4
    drwxrwxrwx 2 root root 4096 2008-08-06 07:22 src
    jonas@Ubuntu4:/opt/OpenCASCADE6.2.0/samples/tutorial$
    Here's what got me confused. I get and error message saying that rm can't remove a directory, but the man pages say they can. I pretty sure that the directory is empty (ls -a) right??? I looked at the permission (ls -l) and it looks like nothing special. I tried "sudo rm src" and that doesn't work. Am I missing something very obvious here???
    Last edited by Jonas thomas; August 6th, 2008 at 03:44 PM. Reason: My question got answered

  2. #2
    Join Date
    Jun 2008
    Location
    England
    Beans
    2,568

    Re: rm command not working for me.

    Try adding a sudo to the start of the command to give tyou admin privs for the command.

    Code:
    sudo rm (file)

  3. #3
    Join Date
    Aug 2007
    Location
    Kottawa, Sri Lanka
    Beans
    7,387
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: rm command not working for me.

    You are running rm on a directory, in which case you would need(since it is empty):-
    Code:
    sudo rmdir name-of-dir
    However if the directory in question contains files, then the command would be:-
    Code:
    sudo rm -r name-of-dir
    Think carefully before executing commands containing "rm", especially "sudo rm -rf ", if you require more information concerning this matter, read this.
    I am an experimenter, give me the most stable OS and I can make it unstable in a few hours.

    C == seriously fast == FTW!

  4. #4
    Join Date
    Apr 2008
    Location
    Midwest usa
    Beans
    378
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: rm command not working for me.

    I tried that, (see the code box) it didn't work.

  5. #5
    Join Date
    Jun 2006
    Location
    Switzerland
    Beans
    Hidden!
    Distro
    Kubuntu Jaunty Jackalope (testing)

    Re: rm command not working for me.

    for a directory you need to use the -R option

  6. #6
    Join Date
    Nov 2006
    Location
    40.31996,-80.607213
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: rm command not working for me.

    Quote Originally Posted by tuxxy View Post
    Try adding a sudo to the start of the command to give tyou admin privs for the command.

    Code:
    sudo rm (file)
    And if it is a directory, use:
    Code:
    sudo rm -R directory
    "Security lies within the user of who runs the system. Think smart, live safe." - Dr Small
    Linux User #441960 | Wiki: DrSmall

  7. #7
    Join Date
    Mar 2008
    Location
    Nashville, Tennessee
    Beans
    287
    Distro
    Xubuntu 18.10 Cosmic Cuttlefish

    Re: rm command not working for me.

    Some of those are directories, so you might want to look into a recursive rm, and this is where you are going to need to be careful!

    Combining the sudo root powers, with recursive removal will do just that. Even if you type something in wrong. It can remove... well... everything.

    What, exactly, are you trying to remove. Can you post the rm command you tried?

    The sudo rm -rf /path/to/directory command will do a wonderful and irreversible job.
    Linux Genuine Advantage: I am licensed!

    Spouting mindless hatred of all things Microsoft since... ummm... never.

  8. #8
    Join Date
    Sep 2007
    Location
    over there
    Beans
    2,521
    Distro
    Ubuntu

    Re: rm command not working for me.

    The command 'rmdir' is used to delete empty directories. To delete directories that contain files, use 'rm -r'.
    "All people are scum. No matter what they look like." ~ Spider Jerusalem, Transmetropolitan #4



  9. #9
    Join Date
    Jun 2008
    Location
    England
    Beans
    2,568

    Re: rm command not working for me.

    Be careful when using rm -rf double check you have the correct paths before executing

  10. #10
    Join Date
    Apr 2008
    Location
    Midwest usa
    Beans
    378
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: rm command not working for me.

    Got it. Thanks all.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •