LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-23-2004, 06:55 AM   #1
chri5
LQ Newbie
 
Registered: Nov 2003
Posts: 22

Rep: Reputation: 15
"cd" to a folder with spaces in it's name?


Hello,
I'm running redhat 9 and was wondering how do I cd to a folder if the folders name has spaces in it?

Say I've got a folder called "My Documents" how would I from the command line get to this folder?

If I type "cd My Documents" it tells me there is no such directory as "My"????

Sorry if this is a silly question but am I missing something here?

Cheers,
Chris.
 
Old 08-23-2004, 06:58 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Use double quotes around the directory:

cd "My Documents"

or escape the space:

cd My\ Documents

Hope this clears things up a bit
 
Old 08-23-2004, 07:05 AM   #3
chri5
LQ Newbie
 
Registered: Nov 2003
Posts: 22

Original Poster
Rep: Reputation: 15
Thanks for the speedy response, it works!!!
 
Old 08-23-2004, 07:18 AM   #4
Shantesh
Member
 
Registered: Aug 2003
Location: Mumbai , INDIA
Distribution: Ubuntu 5.10 | Windows XP Professional
Posts: 82

Rep: Reputation: 15
also try pressing tab...it completes da foldername itself !!
 
  


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
"rm -rf /tmp", now Evolution shows "(no folder displayed" Ed-MtnBiker Linux - Software 7 04-10-2006 05:05 PM
"Mount" a folder into my ftp folder ? 0001001 Linux - General 3 11-27-2005 05:23 AM
[LaTeX] Length of spaces in "Description" Cornholio Linux - Software 1 05-05-2005 03:57 PM
Mandrake 10 "mount smbfs" the win2000 folder from vmware error wuyeguo Mandriva 1 03-19-2004 07:20 PM
Getting rid of "\" before spaces in filenames when using the ls command Locura Linux - Distributions 8 07-05-2003 11:19 PM


All times are GMT -5. The time now is 02:42 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration