New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus • Advice and insight from world-class Apple enthusiasts • Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
Switcher Hangout The place for switchers to discuss their new machines, and how to work with OS X. General support can be had here for newbie stuff, like "How do I restart my new iMac?" :)

How do I access folders that contain space in Terminal. (ie. My Folder)


Post Reply New Thread Subscribe

 
Thread Tools
AlexN
Guest
 
Posts: n/a

How do I access folders that contain space in Terminal. (ie. My Folder)

"cd My Folder" doesn't work.
QUOTE Thanks
caribiner23

 
caribiner23's Avatar
 
Member Since: Feb 06, 2005
Location: Chicago
Posts: 1,499
caribiner23 is just really nicecaribiner23 is just really nicecaribiner23 is just really nicecaribiner23 is just really nicecaribiner23 is just really nice
Mac Specs: MacBook Pro Retina 13" among far too many other Apple products

caribiner23 is offline
You access the directory based on its path.

If you have a directory called "Music" in your home directory, you get there by typing "cd Music" if you're already in your home directory (which is where Terminal puts you by default)

You can also use "cd ~/Music" if you're somewhere other than your home directory.

If you're trying to do all this as the root user, you need to use the absolute path, e.g "cd /Users/username/Music"

If your issue is that you're trying to access a directory that has a space in its name, you tell the UNIX shell to avoid interpreting the space by using a backslash before the offending character. In your example, you would type "cd My\ Folder" (note the backslash before the space before the word "Folder".
QUOTE Thanks
fearlessfreap24

 
fearlessfreap24's Avatar
 
Member Since: Feb 09, 2005
Location: Near San Diego, CA
Posts: 2,339
fearlessfreap24 is just really nicefearlessfreap24 is just really nicefearlessfreap24 is just really nicefearlessfreap24 is just really nice
Mac Specs: MacBook Pro 13" | MacBook Pro 13" | Mac Mini 2GHz C2D

fearlessfreap24 is offline
i have used:

cd "My Folder"

and it worked. You can give that a try.

QUOTE Thanks
trpnmonkey41

 
Member Since: Jul 22, 2003
Location: Hamilton College
Posts: 7,003
trpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to beholdtrpnmonkey41 is a splendid one to behold
Mac Specs: 20" iMac C2D 2.16ghz, 13" MacBook 2.0ghz, 60gb iPod vid, 1gb nano

trpnmonkey41 is offline
The initial directory is your home directory so unless the folder is in their you need to specify the path more

cd /Desktop/My Folder

Don't forget to use the new User Reputation System
QUOTE Thanks
haze

 
Member Since: Aug 17, 2005
Posts: 39
haze is on a distinguished road

haze is offline
Always remember that the tab key is your friend and will autocomplete for you. e.g. typing "cd My" + hitting tab will complete the line for you as "cd My\ Folder/".
QUOTE Thanks
AlexN
Guest
 
Posts: n/a

Quote:
Originally Posted by haze
"cd My\ Folder/".
Oh that's it. "cd My\ Folder" works. Myabe it the escape sequence. got it. Thanks.
QUOTE Thanks
technologist

 
Member Since: Mar 30, 2004
Location: USA
Posts: 4,744
technologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond reputetechnologist has a reputation beyond repute
Mac Specs: 12" Apple PowerBook G4 (1.5GHz)

technologist is offline
Don't forget the easy way...
cd<space>+drag the folder icon from the Finder into the Terminal window.

Much better than trying to type "cd ~/folder/subfolder/subsubfolder/subsubsubfolder/sub...." without making a typo.
QUOTE Thanks

Post Reply New Thread Subscribe


« Photoshop and Illustrator | I am going to stop smoking to buy A G5 »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
finder/pref window,can anyone tell me what this does? iNAP Schweb's Lounge 3 08-31-2005 02:13 PM
Copying one folder over another of the same name destroys data! Cloudane Switcher Hangout 28 05-18-2005 07:10 PM
Cannot Access Home Folder Dalton29 OS X - Operating System 0 11-16-2004 10:06 AM
How to give access to one of my folder by FTP bellastrada Running Windows (or anything else) on your Mac 0 10-09-2004 01:09 PM
slow access on certain folders pierrehk Other Hardware and Peripherals 1 08-05-2004 10:08 AM

All times are GMT -4. The time now is 12:10 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?