Linux How to view and modify PATH environment variables

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.