"Go" ubuntu Add PATH environment variable

Source: Internet
Author: User

Original URL: http://www.cnblogs.com/pang123hui/archive/2011/05/28/2309889.html

There are two types of additions:

First, temporary add

~$ Echo $PATH # Show Current environment variables
/usr/local/sbin:/usr/local/bin # Display example, multiple paths are separated by ":"
~$ path= "$PATH:/home/workdir" # Add "/home/workdir" directory
/usr/local/sbin:/usr/local/bin:/home/workdir # Display example, the middle of multiple paths is still separated by ":"

Then add success! (Of course, you can restart or output it for immediate effect:)
~$ Export PATH
~$ CD ~
~$ source. BASHRC #该命令需在主目录下才能运行, otherwise the prompt cannot be found. BASHRC command
End!

Ii. Permanent Changes

Open the ~/.BASHRC file to the last add command:
Path= $PATH:/home/workdir
Note that unlike the above, there are no double quotes and restart OK.

"Go" ubuntu Add PATH environment variable

Related Article

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.