By modifying .bashrc file:
Vim ~ / .bashrc
// add the last line:
Export the PATH = / usr / local / MongoDB / bin: $ the PATH
into effect the following two methods :()
1, close the current terminal window, reopen a new window will be activated on the terminal
2, input "source ~ / .bashrc" command, the immediate effect
expiration date: permanent
user limitation: the current user only
View PATH: echo $ PATH