How to run Octave from a different directory

bash

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

/Applications/Octave.app/Contents/Resources/bin/octave  

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?

Best Answer

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

alias octave='/Applications/Octave.app/Contents/Resources/bin/octave'