LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
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



Reply
 
Search this Thread
Old 11-18-2005, 11:15 PM   #1
pyrael
Member
 
Registered: Dec 2003
Posts: 87

Rep: Reputation: 15
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?
 
Old 11-18-2005, 11:20 PM   #2
pyrael
Member
 
Registered: Dec 2003
Posts: 87

Original Poster
Rep: Reputation: 15
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
 
Old 11-18-2005, 11:29 PM   #3
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
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 11:33 PM.
 
Old 11-18-2005, 11:30 PM   #4
tsphan
Member
 
Registered: Jan 2005
Location: Clackamas, Oregon, US
Distribution: Slackware 10.2
Posts: 154

Rep: Reputation: 30
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.
 
Old 11-19-2005, 01:35 AM   #5
pyrael
Member
 
Registered: Dec 2003
Posts: 87

Original Poster
Rep: Reputation: 15
Thanks Harishankar and tsphan,

I'll set that to memeory, It's good to know... It was driving me batty for a while LOL
 
Old 11-19-2005, 06:30 AM   #6
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Rep: Reputation: 31
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.
 
Old 11-19-2005, 06:34 AM   #7
linmix
Senior Member
 
Registered: Jun 2004
Location: Spain
Distribution: FC5
Posts: 1,993
Blog Entries: 1

Rep: Reputation: 46
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
 
Old 11-20-2005, 12:28 AM   #8
vharishankar
Senior Member
 
Registered: Dec 2003
Posts: 3,142
Blog Entries: 4

Rep: Reputation: 121Reputation: 121
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-20-2005 at 12:31 AM.
 
Old 11-22-2005, 06:42 AM   #9
pyrael
Member
 
Registered: Dec 2003
Posts: 87

Original Poster
Rep: Reputation: 15
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
 
Old 11-22-2005, 06:52 AM   #10
Optimistic
Member
 
Registered: Jun 2004
Location: Germany
Distribution: Debian (testing)
Posts: 276

Rep: Reputation: 31
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!
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A question about expect. imjoe Programming 1 10-26-2005 05:42 AM
expect question deiussum Programming 0 08-05-2005 04:51 PM
expect question reitzell Programming 1 11-20-2004 10:03 AM
The dumbest question ever... kardinal Linux - Newbie 8 10-16-2004 05:46 AM
How do I start gnome? **Dumbest question ever** jimmythenewbie Linux - Newbie 2 11-24-2001 03:52 AM


All times are GMT -5. The time now is 11:36 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