image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
Thread Tools
  #1  
Old September 25th, 2004, 06:20 AM
Registered User
 
Join Date: Jun 2004
Posts: 173
Thanks: 0
Thanked 0 Times in 0 Posts
Elliotjnewman is on a distinguished road
terminal shortcuts

is there a way of creating shortcuts for directories and applications so that when, say you want to open Safari.app you dont have to goto ~/Applications and then open Safari.app.

It would be nice if I could open a shell and type safari - and there it pops up! I work with Linux in a big company and I can open any application by just typing it in, I dont have to be in the correct directory...

Sorry for the newbee question. And I have tried searching for it...

E.
Reply With Quote
  #2  
Old September 26th, 2004, 06:18 PM
gumse's Avatar
Member
 
Join Date: Mar 2001
Location: Sweden
Posts: 403
Thanks: 0
Thanked 0 Times in 0 Posts
gumse is on a distinguished road
To open Safari from cli directly you have type:
/Applications/Safari.app/Contents/MacOS/Safari
You could add the path to safari by adding the following to your .bash_profile :
PATH=${PATH}:/Applications/Safari.app/Contents/MacOS/Safari , but then you will start a new instance of Safari on each invocation.
Better to add: alias safari="open -a Safari" to .bashrc
__________________
G4 500 MP 1024 MB RAM
LaCie Electron 22" Display
OS X 10.3.9
iMacDV
MacMini
iSight
iPod + iPod Mini
Sony PC100E FireWire Cam
Static IP via a FreeBSD server/gateway
a lot of other Mac's running Macos 7.5 to 9.1 and NetBSD.
A Few Wintel's on the side (I only use them when I get paid by the hour)
Reply With Quote
  #3  
Old September 26th, 2004, 06:33 PM
Registered User
 
Join Date: Jun 2004
Posts: 173
Thanks: 0
Thanked 0 Times in 0 Posts
Elliotjnewman is on a distinguished road
so doing "Better to add: alias safari="open -a Safari" to .bashrc" means I can open safari from a shell by just typing "open -a Safari"?

Could you explain how I would do this? and does it refere to other apps too?

Is this quite a tricky thing to do with terminal? I would have though it was quite straight forward to set up alias commands to open things...
Reply With Quote
  #4  
Old September 26th, 2004, 06:49 PM
gumse's Avatar
Member
 
Join Date: Mar 2001
Location: Sweden
Posts: 403
Thanks: 0
Thanked 0 Times in 0 Posts
gumse is on a distinguished road
You probably don't have a file called ".bashrc" in your home directory, check with "ls -a" in terminal, files beginning with "." are invisible in the Finder.

.bashrc is a simple textfile in you home directory, you can create it with any text editor, just be sure to save it as "text only". After you create and save ".bashrc" it is read avery time you open a new terminal window. Then you only have to type "safari" to open Safari, but you could open Safari from the terminal with "open -a Safari" directly without messing with any files at all.
The alias entry in ". bashrc" just replaces "safari" with "open -a Safari" to save some typing effort.
Try "man open" in a terminal to learn more.
__________________
G4 500 MP 1024 MB RAM
LaCie Electron 22" Display
OS X 10.3.9
iMacDV
MacMini
iSight
iPod + iPod Mini
Sony PC100E FireWire Cam
Static IP via a FreeBSD server/gateway
a lot of other Mac's running Macos 7.5 to 9.1 and NetBSD.
A Few Wintel's on the side (I only use them when I get paid by the hour)
Reply With Quote
  #5  
Old October 6th, 2004, 12:21 PM
whyre's Avatar
*nix Geek
 
Join Date: May 2004
Location: Florida
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
whyre is on a distinguished road
Smile Quicksilver

Well, a nice free program that will allow you to launch and manipulate files without having to type a full path is Quicksilver. All you do is activate it with a hotkey (command-space for example) and start typing in safari and it will pop up with the option to launch. Of course, there are many more things you can do with Quicksilver, but it makes launching programs easier and keeps your dock neat.
__________________
OS 10.4.10
PowerBook: G4 1.5Ghz 80Gb 1.5GB Ram Ati-9700 (128Ram) Superdrive
iPod Video 5th gen, black 30GB
AirPort Express with AirTunes
Reply With Quote
Reply

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -5. The time now is 09:10 AM.


Mac Support® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.