Linux PATH variable settings, linuxpath variable

Source: Internet
Author: User

Linux PATH variable settings, linuxpath variable

In general Linux, there are two configuration files that can be used to set the PATH variable, one:. bashrc two:. bash_profile; there is also a way to temporarily set the PATH variable (3)

 

1. Edit. bashrc and add export PATH = $ PATH:/home/myname/mydirectory. This is to keep the PATH behind the existing PATH. Or:

Export PATH =/home/myname/mydirectory: $ PATH this is to put the PATH at the beginning.

2. Enter the source. bashrc command in bash.

2. 1. Edit. bash_profile and add export PATH = $ PATH:/home/myname/mydirectory. To put the PATH in front of "reference 1.

2. log out of the user and log on again to activate the function.

3. In this shell session, use the custom PATH, export PATH = $ PATH:/home/myname/mydirectory to close the shell and no longer activate this PATH configuration.

 

Conclusion: After all the paths are set, run the following command to view the PATH: echo $ PATH

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.