Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place. |
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.
|
 |
11-18-2005, 10:15 PM
|
#1
|
Member
Registered: Dec 2003
Posts: 87
Rep:
|
Possibly the dumbest question I would ever expect to ask
I have been using linux for quite some time now, but there is one thing that is REALLY erking me........
I dual boot XP and FC4, That works OK (wish I could just get rid of XP all together). My problem is with the command prompt. I mount the windows directory, usually with:
# mount /dev/hda1 /windows
Works fine, I can access the folder ok. But, I cannot cd to folders with names containing spaces! If I type ls, they exist..... so I know they are readable to linux. I can do this fine from the desktop (Gnome or KDE) but for some reason not from the command line. I tried using for example:
# cd /windows/Documents_and_Settings
#cd /windows/Documents%&and%&Settings
#cd /windows/Documents&%and&%Settings
#cd /windows/Documents%and%settings
as well as ALOT of other ascii combos I thought might work.
What makes it possible for gnome and KDE to navigate these folders?
|
|
|
11-18-2005, 10:20 PM
|
#2
|
Member
Registered: Dec 2003
Posts: 87
Original Poster
Rep:
|
Cancel that question LOL
I figured it out after trying one last passing thought
#cd 'Documents and Settings'
That did it fine LOL
maybe someone else will wonder and and find this helpful
|
|
|
11-18-2005, 10:29 PM
|
#3
|
Senior Member
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Rep: 
|
You can also do like this:
Code:
cd /mnt/C:/My\ Documents/Some\ Folder\ with\ Spaces
That is use the backlash as an escape character to use spaces which are part of file and folder names.
Note: The use of colours is just for easily understanding the folder names. Otherwise it might have been confusing.
Last edited by vharishankar; 11-18-2005 at 10:33 PM.
|
|
|
11-18-2005, 10:30 PM
|
#4
|
Member
Registered: Jan 2005
Location: Clackamas, Oregon, US
Distribution: Slackware 10.2
Posts: 154
Rep:
|
or, you could use a "\" as a sign to tell it to add the next character, for example:
Code:
$ cd Documents\ and\ Settings
\ is telling it to add the space.
|
|
|
11-19-2005, 12:35 AM
|
#5
|
Member
Registered: Dec 2003
Posts: 87
Original Poster
Rep:
|
Thanks Harishankar and tsphan,
I'll set that to memeory, It's good to know... It was driving me batty for a while LOL
|
|
|
11-19-2005, 05:30 AM
|
#6
|
Member
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276
Rep:
|
What's with all this pointless typing? Haven't you discovered the awsomeness that is TAB completion?
Type part of the file name then hit TAB and the directory will be typed for you. If there is more than one match then hit TAB again and it will show you what matches what you have so far.
Plus, this helps to cutdown on typing mistakes which waste time.
Try it out, I prommise that you will use it all the time.
In fact, I use it so much that I accidently assume that everything has tab complete and will hit TAB when I'm typing URLs sometimes.
|
|
|
11-19-2005, 05:34 AM
|
#7
|
Senior Member
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Rep:
|
Even when you use TABbing you need to know about escaping spaces (using '\ ') since there could be two direcories with the space in te same place:
My Documents
My Music
No amount of tabbing gets you through that one 
|
|
|
11-19-2005, 11:28 PM
|
#8
|
Senior Member
Registered: Dec 2003
Distribution: Debian
Posts: 3,178
Rep: 
|
Quote:
No amount of tabbing gets you through that one
|
Ah, yes. Before I knew tab completion, I used to wrap it in quotes too 
Last edited by vharishankar; 11-19-2005 at 11:31 PM.
|
|
|
11-22-2005, 05:42 AM
|
#9
|
Member
Registered: Dec 2003
Posts: 87
Original Poster
Rep:
|
I forgot about tabbing
I did use it for a long time, then I started using DOS again for a while (installing OS's for people) and got used to the DOS restrictions again.
It's really annoying to hit the up arrow and NOT have your last command listed again. LOL
I'll start using it again now that you reminded me  although the escape is still very valid and useful info too
|
|
|
11-22-2005, 05:52 AM
|
#10
|
Member
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276
Rep:
|
I didn't mean to suggest that knowing the escape character was unimportant---quite the contrary, you gotta know that. I just wanted to point out that TAB rules! 
|
|
|
All times are GMT -5. The time now is 05:01 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
|
|