online at
twitter
LinkedIn
BlipFM
Vimeo
yelp
facebook

Creating an Alias in Terminal on Mac OSX 10.5

This is a cool way to quickly execute commonly used commands in shell. In this particular example, I show you how to quickly navigate to a commonly used folder.

Make sure you are in your root directory./Users/yourUsername

Create a file called .profile. I prefer to use vi for this purpose.

$ vi .profile

If you’re new to vi, here are the basic commands you will need to remember for this task.

* : x [return] to close and save the file
* i to insert text before the cursor until you press [esc]

More basic vi commands

Now it’s time to create the alias, type in the following into your new file,

alias yourLabel=”/path/to/commonly/”Used Directory”

Close and save the file. Now, make sure to restart Terminal, or the changes will not be reflected. Once you have restarted Terminal, simply type in the alias …

$ yourLabel

… and voila!

Tags: ,

Leave a Reply