Find the answer to your Linux question:
Results 1 to 5 of 5
I made I typo in my /etc/fstab file where I told a disk to mount to /media/Windows\ Storage It created that folder but named it "Windows\" (I guess fstab doesn't ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2011
    Posts
    5

    How do I delete a folder with \ at the end?


    I made I typo in my /etc/fstab file where I told a disk to mount to /media/Windows\ Storage
    It created that folder but named it "Windows\" (I guess fstab doesn't recognize the space the way the terminal does).now when I try to remove it the terminal detects \ to allow for a space and it says "cannot remove 'Windows': no such file or directory." Anyone know how I can go about deleting the folder?

  2. #2
    rrl
    rrl is offline
    Just Joined!
    Join Date
    May 2011
    Location
    NJ
    Posts
    56
    Hello,

    Try renaming it, then deleting it.

  3. #3
    Administrator jayd512's Avatar
    Join Date
    Feb 2008
    Location
    Kentucky
    Posts
    5,023
    You're likely having trouble because of the space after the slash. When attempting to delete the folder, try using your <tab> key to auto-complete the name.
    Jay

    New users, read this first.
    New Member FAQ
    Registered Linux User #463940
    I do not respond to private messages asking for Linux help. Please keep it on the public boards.

  4. #4
    Linux Engineer
    Join Date
    Apr 2012
    Location
    Virginia, USA
    Posts
    882
    rm Windows\\
    \ instructs bash to interpret the next character as text.

    So, if the directory is named Windows\ Share
    You would have to use \\.

    Pro tip: Don't ever use spaces in file and directory names. There's just no good reason to do so; as you can see, it's only going to cause you grief. Use _ underscore instead.

  5. #5
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Quote Originally Posted by mizzle View Post

    Pro tip: Don't ever use spaces in file and directory names. There's just no good reason to do so; as you can see, it's only going to cause you grief. Use _ underscore instead.
    Solid advice right there. I rename every single download to avoid the grief, it can be a major hassle.

    EDIT: Another way to look at the folder is to use the dir command. For example:
    Output of ls
    Code:
    00002.vcf                         George-thorogood.WAV       loki_update-full-1.0.13-x86.run
    cnijfilter-3.20-r1.ebuild         gtk-gnutella-downloads     MANUAL000006616.pdf
    conky.sh                          how-to-gentoo-consolefont  output
    Desktop                           IMG_20110815_174241.jpg    shared
    Downloads                         installed-progs            tmp
    dwhelper                          iso                        VirtualBox VMs
    Foo Fighters - Greatest Hits.m3u  loki_update-1.0.6-x86.run  workspace

    Output of dir

    Code:
    00002.vcf                             George-thorogood.WAV       loki_update-full-1.0.13-x86.run
    cnijfilter-3.20-r1.ebuild             gtk-gnutella-downloads     MANUAL000006616.pdf
    conky.sh                              how-to-gentoo-consolefont  output
    Desktop                               IMG_20110815_174241.jpg    shared
    Downloads                             installed-progs            tmp
    dwhelper                              iso                        VirtualBox\ VMs
    Foo\ Fighters\ -\ Greatest\ Hits.m3u  loki_update-1.0.6-x86.run  workspace
    So you cannot type cd VirtualBox VMs, you'll get an error.
    Code:
    cd VirtualBox VMs
    bash: cd: VirtualBox: No such file or directory
    But if you use the output from the dir command
    cd VirtualBox\ VMs
    It works. Also as metioned, just use the {Tab} button to autocomplete for you.
    cd Vir{Press tab once}
    Last edited by MikeTbob; 01-27-2013 at 04:00 PM.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

Posting Permissions

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