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
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

Newbie using terminal


Post Reply New Thread Subscribe

 
Thread Tools
Franknfurter

 
Member Since: Feb 14, 2008
Posts: 15
Franknfurter is on a distinguished road

Franknfurter is offline
In Tiger I'm using Pico in Terminal to write html pages.
I don't know how to change to directories that have spaces, quotes or underscores in their names.
When I type the full name, or the first 6 characters followed by ~1, Terminal just goes to a new line consisting of > and does not respond to any commands.
Can I move into my long directory name_files or open a file within it? or do i have to rename everything to a name that Terminal can cope with?
Advice would be gratefully received.
Frank
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 3,130
cradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant futurecradom has a brilliant future
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is online now
To cd to a folder with a space in it you need to "escape" the name. For instance:
cd ~/folder/'folder with space'
You can also use a " as an escape.
Naming folders with quotes is NOT recommended.
Folder names with underscores should work correctly as is.

Craig Domingue - resident redneck.
“Never argue with an idiot. He will only bring you down to his level and beat you with experience.”, George Carlin
QUOTE Thanks
ismouton

 
Member Since: Dec 31, 2007
Posts: 5
ismouton is on a distinguished road

ismouton is offline
Remember that you can use the \ as the escape. For example you have a file called:

/Users/Frank Sinatra/my songs/"Eye" by Smashing Pumpkins, the.mp3

You can use it in terminal as:

/Users/Frank\ Sinatra/my\ songs/\"Eye\"\ by\ Smashing\ Pumpkins\,\ the.mp3

or

'/Users/Frank Sinatra/my songs/"Eye" by Smashing Pumpkins, the.mp3'
QUOTE Thanks
Franknfurter

 
Member Since: Feb 14, 2008
Posts: 15
Franknfurter is on a distinguished road

Franknfurter is offline
Thank you very much.
Both work.
I've also discovered the use of the wild card * gives every file that starts with the typed characters. Good shorthand for where there are few files or folders to choose from. Sticking the * in the middle of the path allows you to define the starting and ending characters of the files or folders you want to select.
Frank
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,638
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
Keep in mind you don't actually have to type all that either. OS X, like many other *nix OS's has tab completion. So for example in the above commands I'd type

/Us (hit tab, so it'll now say)
/Users/ (then type) Frank (hit tab)
/Users/Frank\ Sinatra/my (tab)

etc it will continue to build the command structure for you. I hope that made some sense, if not... try hitting the tab key while you're typing out your file path and see what happens.

mike
This machine kills fascists
Got # ? phear the command line!
QUOTE Thanks

Post Reply New Thread Subscribe


« Installing GCC 4.3 | Results in XCode »
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
Terminal issue sarjas OS X - Apps and Games 1 01-02-2008 10:30 PM
Terminal problems please help CliveO OS X - Operating System 6 03-20-2007 10:04 AM
Terminal Problem WROC OS X - Apps and Games 5 01-09-2007 04:01 PM
Terminal Help rs2sensen OS X - Apps and Games 1 04-25-2005 10:52 PM
newbie help (dumb terminal settings?) CaptainMack OS X - Development and Darwin 10 02-17-2004 07:25 PM

All times are GMT -4. The time now is 01:52 PM.

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?