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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-15-2004, 11:51 AM
|
#1
|
LQ Newbie
Registered: Aug 2004
Posts: 6
Rep:
|
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 )??
|
|
|
09-15-2004, 11:54 AM
|
#2
|
Member
Registered: Sep 2004
Distribution: Debian testing
Posts: 49
Rep:
|
rm New\ Directory
rjtucke
|
|
|
09-15-2004, 11:56 AM
|
#3
|
Member
Registered: May 2003
Location: UK
Distribution: Gentoo
Posts: 141
Rep:
|
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.
|
|
|
09-15-2004, 11:57 AM
|
#4
|
LQ Newbie
Registered: Aug 2004
Posts: 6
Original Poster
Rep:
|
Thank you!!!!!!
|
|
|
12-02-2014, 09:14 AM
|
#5
|
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374
Rep:
|
Trying to delete System Volume Information directory.
This does not work.
rm -r /mnt/sdb1/System\ Volume Information
|
|
|
12-02-2014, 09:16 AM
|
#6
|
LQ Addict
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 23,029
|
My god, so can't you add a second \ ?
|
|
|
12-02-2014, 09:46 AM
|
#7
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
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.
|
|
|
12-02-2014, 10:08 AM
|
#8
|
Member
Registered: Apr 2004
Location: Mesa, AZ USA
Distribution: Slackware 14.1 kernel 4.1.13 gcc 4.8.2
Posts: 246
Rep:
|
Another way is to put the file name in quotes using the apostrophe mark.
Example:
rm 'file with space'
|
|
|
12-02-2014, 10:23 AM
|
#9
|
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374
Rep:
|
Quote:
Originally Posted by Arcosanti
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.
|
|
|
12-02-2014, 10:27 AM
|
#10
|
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374
Rep:
|
rm -rf 'system volume information' works.
That dir had sub dirs.
Last edited by Fixit7; 12-02-2014 at 10:29 AM.
|
|
|
12-02-2014, 10:31 AM
|
#11
|
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374
Rep:
|
Quote:
Originally Posted by pan64
My god, so can't you add a second \ ?
|
If you can not cheerfully help, please don't answer any posts !!
|
|
|
12-02-2014, 10:38 AM
|
#12
|
Senior Member
Registered: Aug 2006
Location: Detroit, MI
Distribution: GNU/Linux systemd
Posts: 4,278
|
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.
|
|
|
12-02-2014, 11:21 AM
|
#13
|
Senior Member
Registered: Mar 2014
Location: El Lago, Texas
Distribution: Ubuntu_Mate 16.04
Posts: 1,374
Rep:
|
Quote:
Originally Posted by szboardstretcher
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.
|
|
|
All times are GMT -5. The time now is 03:51 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|