Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have recently installed Octave, a MATLAB clone, onto the following directory:


I want to run it from a shell command prompt from a different directory, say, from my home directory ~. I know that I can type the full path to the octave executable, but that is very cumbersome. I know that on linux computers you can edit your .bashrc file to include paths to special directories with executables. How do I accomplish that here in Mac OS?

share|improve this question
up vote 2 down vote accepted

Edit your .bashrc (or .bash_profile, .login, etc.) on a Mac, and add the line

alias octave='/Applications/'
share|improve this answer
In linux computers, aliases don't pass into shell scripts. This is why we export paths to the bashrc file. I imagine mac computers have the same problem. Is there a way to include this path for later use in shell scripts? – Paul May 2 '12 at 13:29
In linux computers, and OS X, login scripts (.bashrc, .bash_profile) are treated differently by user login (interactive shell) versus script. Put the alias in the appropriate place (linux or OS X) and your shell scripts will have access to the alias. I think .bashrc is interactive only, and .bash_profile is accessed by shell scripts. – user588 May 2 '12 at 15:31

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.