You'll have to add the location of the Mongo binary to PATH.
Follow the steps below in order to make the PATH variable permanent:
- Open Terminal and navigate to your user directory.
- Run
touch ~/.bash_profile
and then open ~/.bash_profile
.
- In TextEdit, add
export PATH="<mongo-directory>/bin:$PATH"
(Keep the quote marks - related to white spaces).
- Save the
.bash_profile
file and Quit (Command + Q) Text Edit.
- Run
source ~/.bash_profile
.
- Run
echo $PATH
and check if the you see that the Mongo binary was added.
(*) Notice that the PATH variable is now available only for the current terminal and not to processes that were already started in the session.
In order to make it available outside the current terminal - you'll have to logout and login.