LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 08-22-2003, 09:56 AM   #1
zekko
Member
 
Registered: Aug 2003
Location: Canada
Distribution: Slackware, debian
Posts: 76

Rep: Reputation: 15
Newb question


Hey, how do I cd to directories with spaces in them? I'm browsing my windows drive and I type:

[j@localhost windows]$ cd Program Files
bash: cd: Program: No such file or directory

I also tried Program%Files but it didn't work either.

Thanks.
 
Old 08-22-2003, 10:21 AM   #2
sorrodos
Member
 
Registered: Jul 2003
Location: Salt Lake City, UT and Spokane, WA
Distribution: Mandrake 10.0, Gentoo, FreeSBIE 1.0
Posts: 345

Rep: Reputation: 30
Oh shoot, I used to remember how to do this... but now I am just lazy when using cd and use wildcards... so in your case I would just type something like:

cd Prog*

That will work as long as you don't have two directories that are spelled the same prior to the space and differently after...
 
Old 08-22-2003, 12:12 PM   #3
ephem
LQ Newbie
 
Registered: Aug 2003
Distribution: RedHat 9.0
Posts: 10

Rep: Reputation: 0
try encapsulating the entire directory name within quotation marks..

cd "my directory"
 
Old 08-22-2003, 05:01 PM   #4
pHoeNIgS
LQ Newbie
 
Registered: Aug 2003
Distribution: Mandrake 9.1
Posts: 21

Rep: Reputation: 15
hmmm......good question

when you want to go to a directory with spaces, for example (c:\)Program Files,
type

cd /Program\ Files

i think it also works with question marks aso....

cd /mp3/band\-album

the backslash is the key
 
Old 08-22-2003, 05:26 PM   #5
synecdoche
Member
 
Registered: Jul 2003
Location: British Columbia, Canada
Distribution: CollegeLinux 2.5
Posts: 148

Rep: Reputation: 15
I always just put it in quotation marks. Seems easiest.

-dave
 
  


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
Newb C++ question Scotty2435 Programming 9 03-05-2006 04:38 AM
Newb question sicness Slackware 4 11-09-2005 03:40 AM
Newb Question Tsarok Fedora 5 07-14-2005 02:05 PM
Newb Question nFecTeD Linux - Newbie 1 06-07-2005 06:24 PM
A Newb Question pt. 2 gnr2k3 Linux - Newbie 3 08-30-2003 05:37 PM


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

Main Menu
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