When I said type
echo $PATH
I did mean PATH in ALL CAPITALS. When working on the Unix side of Mac OS X, as weill all Unix systems upper and lower case do matter.
But from the error message, I can see that somewhere along the way, mongodb (a database package), and the modification of PATH was done incorrectly.
If you installed MongoDB, AND if the instructions had to modify your .profile (or perhaps .bash_profile), then either their instructions were wrong, or you missed a step, which explains why you can not enter commands are not found
PATH is a Unix environment variable that contains a colon separate list of directories where the shell will look for commands when you enter them at the command prompt.
So your choices are delete the offending .profile (or perhaps .bash_profile) and forget about MongoDB, or if you do need MongoDB, then fix your .profile (or .bash_profile) so it has a properly formed PATH environment variable.
Fixing this would look like
/bin/ls -a # this will show you all the files starting with a period (dot) as in .profile or .bash_profile
/usr/bin/nano .profile
now in this text editor use the arrow keys, and the delete key to find and delete offending text, then type in the corrected text. Nano gives you a menu at the botton of the editor with additional commands. ^O (Control-O) writes out any changes you made. ^X (Control-X) exits from Nano.
You want your PATH variable to look like (REMEMBER UPPER/lowercase is IMPORTANT) ALSO spaces or nospaces are important.
export PATH="/usr/local/mongodb-osx-x86_64-1.8.2:$PATH"
NOTICE there is a colon between the MongoDB directory path, and the $PATH. The $PATH will append your existing PATH to the end of the new PATH environment variable you are setting up. The entire PATH string is enclosed in double quotes. ALSO NOTICE, there is only 1 space between export and PATH. No spaces anywhere else in the line.
Again, I used .profile as the most likely file name, HOWEVER, your shell will look for 1 of 3 different initialization files starting with
.bash_profile
.bash_login
.profile
If will use the first file it finds in the above order and stop looking as soon as it finds a match. So it is important that you edit the correct file. The
/bin/ls -a
command will tell you want leading period filenames exist in your home directory
I'll also give you one word of caution. When playing on the Unix side of Mac OS X, and following instructions you do not understand, it is generally wise to have a very recent full backup of your system. There are some commands that can make your system unusable should you enter them blindly.
Message was edited by: BobHarris