Results 1 to 7 of 7

Thread: Using RM

  1. #1
    Join Date
    Jan 2009
    Location
    Denmark
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Using RM

    When i try to delete a folder, containing subfolders and files. the command rm (file name) won't work. So im wondering what i need to add to rm to be able to delete the folder and it's content in the command-line-interface.

    Thanks on advance, best regards Dren

  2. #2
    Join Date
    Feb 2006
    Location
    Adelaide, South Australia
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Re: Using RM

    Code:
    man rm
    You're after the -r switch but please.. Do take care using this command. One typo can mean losing a lot of data.
    Linux Mint 8 64 Bit | Intel Core 2 Duo CPU E8500 @ 3.80GHz (OC) | 4GB Kingston RAM | Asus P5Q Delux Motherboard | Asus EN9800GT (NVIDIA) | WD 120GB / WD 720GB SATA2 HDDs

  3. #3
    Join Date
    Mar 2007
    Beans
    46
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Using RM

    You can always check the manual for the command
    Code:
    man rm
    Together with other stuff, it says:
    Code:
           -r, -R, --recursive
                  remove directories and their contents recursively
    edit:// sniped >.<

  4. #4
    Join Date
    Apr 2006
    Beans
    72

    Re: Using RM

    Quote Originally Posted by Drenriza View Post
    When i try to delete a folder, containing subfolders and files. the command rm (file name) won't work. So im wondering what i need to add to rm to be able to delete the folder and it's content in the command-line-interface.

    Thanks on advance, best regards Dren
    rm -r

  5. #5
    Join Date
    Jan 2009
    Location
    Denmark
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Using RM

    Thanks for the replies. But unfurtiantly i can't delete the file using
    rm -r filename. what i wanna delete is a folder on my desk a "test folder" if u can call it that.

    It's been given the name Usb Backup and putted some stuff into it.
    but when i type rm -r Usb Backup it says it cannot delete the file or dictorary....???

  6. #6
    Join Date
    Jul 2008
    Location
    Birmingham, England
    Beans
    2,400

    Re: Using RM

    You need to be in the directory occupied by Usb backup. Plus you need to write it as Usb\ Backup to signify the space

  7. #7
    Join Date
    Mar 2009
    Location
    E.U.
    Beans
    303
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Using RM

    Code:
    cd /home/username/Desktop
    then rm -r [name of file]

    note: substitute your username for "username"

    or simply:

    rm -r /home/username/Desktop/filename

Tags for this Thread

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
  •