Linux How to view and modify PATH environment variables
See Path:echo $PATH
To add a MongoDB server as a column
Modify method One:
Export Path=/usr/local/mongodb/bin: $PATH
Once configured, you can view the configuration results through the echo $PATH.
Effective method: Immediate effect
Validity period: Temporary change, only in the current terminal window, the current window will be restored after the original path configuration
User limitations: Only for the current user
Modify method Two:
By modifying the. bashrc file:
Vim ~/.BASHRC
Add on the last line:
Export Path=/usr/local/mongodb/bin: $PATH
Effective method: (There are the following two kinds)
1. Close the current terminal window and reopen a new terminal window to take effect
2. Enter "source ~/.BASHRC" command, effective immediately
Expiry date: Permanently valid
User limitations: Only for the current user
Modify method Three:
By modifying the profile file:
Vim/etc/profile
/export Path//Find the line that sets path, add
Export Path=/usr/local/mongodb/bin: $PATH
Effective method: System restart
Expiry date: Permanently valid
User limitations: For all users
Modify method Four:
By modifying the environment file:
Vim/etc/environment
In Path= "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games", add ":/usr/ Local/mongodb/bin "
Effective method: System restart
Expiry date: Permanently valid
User limitations: For all users
Linux How to view and modify PATH environment variables