LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 09-15-2004, 11:51 AM   #1
budhead
LQ Newbie
 
Registered: Aug 2004
Posts: 6

Rep: Reputation: 0
Can't delete directory with space in name


After extracting a tar file that created a directory with a space in the name (New Directory) I cannot delete that directory. The command returns a message that the directory does not exist. I've tried rmdir New, rmdir Directory, rmdir NewDirectory, rmdir New_Directory, and of course, rmdir New Directory. Nothing works. I can delete it from the GUI, but not from the CLI. Any ideas (yes, I'm interested to know how to do it from the CLI even though I can do it from the GUI--I've just GOT to know )??
 
Old 09-15-2004, 11:54 AM   #2
rjtucke
Member
 
Registered: Sep 2004
Distribution: Debian testing
Posts: 49

Rep: Reputation: 16
rm New\ Directory

rjtucke
 
Old 09-15-2004, 11:56 AM   #3
geniarse
Member
 
Registered: May 2003
Location: UK
Distribution: Gentoo
Posts: 141

Rep: Reputation: 15
space is ignored by commands as interpreted as end of file. to remove file "Space Between.txt" use:

Code:
rm Space\ Between.txt
p.s I thought I might draw your attention to tab completion. type the first few letters of the file/directory name hit tab and the name will be completed. If multiple files/directories with same beginning letters exist tapping tab twice will show a list of matching files

Last edited by geniarse; 09-15-2004 at 11:59 AM.
 
Old 09-15-2004, 11:57 AM   #4
budhead
LQ Newbie
 
Registered: Aug 2004
Posts: 6

Original Poster
Rep: Reputation: 0
Thank you!!!!!!
 
Old 12-02-2014, 09:14 AM   #5
Fixit7
Member
 
Registered: Mar 2014
Posts: 314

Rep: Reputation: 1
Trying to delete System Volume Information directory.

This does not work.

rm -r /mnt/sdb1/System\ Volume Information
 
Old 12-02-2014, 09:16 AM   #6
pan64
Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian i686 (solaris)
Posts: 5,152

Rep: Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364Reputation: 1364
My god, so can't you add a second \ ?
 
Old 12-02-2014, 09:46 AM   #7
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,410
Blog Entries: 1

Rep: Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115
What he means is:

Code:
rm -r /mnt/sdb1/System\ Volume\ Information
Really learn about tab completion as this kind of escaping is made quicker.
 
Old 12-02-2014, 10:08 AM   #8
Arcosanti
Member
 
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 13.37 kernel 2.6.39.1 gcc 4.5.2
Posts: 180

Rep: Reputation: 9
Another way is to put the file name in quotes using the apostrophe mark.

Example:

rm 'file with space'
 
Old 12-02-2014, 10:23 AM   #9
Fixit7
Member
 
Registered: Mar 2014
Posts: 314

Rep: Reputation: 1
Quote:
Originally Posted by Arcosanti View Post
Another way is to put the file name in quotes using the apostrophe mark.

Example:

rm 'file with space'
It did not work on my system.
 
Old 12-02-2014, 10:27 AM   #10
Fixit7
Member
 
Registered: Mar 2014
Posts: 314

Rep: Reputation: 1
rm -rf 'system volume information' works.
That dir had sub dirs.

Last edited by Fixit7; 12-02-2014 at 10:29 AM.
 
Old 12-02-2014, 10:31 AM   #11
Fixit7
Member
 
Registered: Mar 2014
Posts: 314

Rep: Reputation: 1
Quote:
Originally Posted by pan64 View Post
My god, so can't you add a second \ ?
If you can not cheerfully help, please don't answer any posts !!
 
Old 12-02-2014, 10:38 AM   #12
szboardstretcher
Senior Member
 
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 3,410
Blog Entries: 1

Rep: Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115Reputation: 1115
Report it to the mods if you disagree with it, no use in starting an argument and filling up the thread with flames.

Have you gotten around to using tab-completion as advised? You make no further mention of it, and it is truly the best way for dealing with filenames and directories with special characters.

Also, replies like:

Quote:
It did not work on my system.
Are useless. You should always point out what you've tried, what you typed, a copy/paste of the input and output, if you expect any kind of effective help.
 
Old 12-02-2014, 11:21 AM   #13
Fixit7
Member
 
Registered: Mar 2014
Posts: 314

Rep: Reputation: 1
Quote:
Originally Posted by szboardstretcher View Post
Report it to the mods if you disagree with it, no use in starting an argument and filling up the thread with flames.

Have you gotten around to using tab-completion as advised? You make no further mention of it, and it is truly the best way for dealing with filenames and directories with special characters.
I found a good answer and am happy with it.

Take care.

I would think that moderators read posts, but I did report it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cant delete directory linuxmandrake Linux - Newbie 4 08-16-2005 12:14 PM
shell script: delete all directories named directory.# except directory.N brian0918 Programming 3 07-13-2005 07:54 PM
Preinstalled Win XP Pro: Keep or Delete? Needed or just taking up space? hanzj Linux - Newbie 11 04-20-2005 07:35 PM
save space and delete old packages ctagg Linux - Newbie 1 03-14-2005 05:33 PM
Not enough space for root directory on a drive with 50g free space??? auoq Linux - Newbie 1 10-13-2004 01:44 PM


All times are GMT -5. The time now is 08:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration