Environment variable configuration,

Source: Internet
Author: User

Environment variable configuration,
View and modify the environment variable PATH in Windows

Right-click "this computer", click "properties", and select "Advanced System settings" on the left, as shown in figure

 

Select "advanced" and click "environment variables", as shown in

The last part is the current user's environment variable, and the next part is the system environment variable. It applies to all users. Generally, modifying the PATH is to change the system variable.

Click "new" and set the variable name and variable value to create an environment variable. (For example)

Click "edit". On the right of the new window, you can create, edit, browse, and delete variable values. Moving up or down can change the order of variable values. (For example)

Similarly, click "delete" to delete the selected environment variables.

 

In Linux, view the PATH environment variable.

$ PATH: environment variable, format:

PATH = $ PATH: <PATH 1 >:< PATH 2 >:< PATH 3 >:------: <path n>

Used Between pathsColonAfter the change, it will take effect the next time the user logs in.

To take effect immediately, run the source command.

Command for viewing the PATH value:

$ Export

Command for viewing PATH environment variables:

$ Echo $ PATH

Command to add the PATH environment variable:

$ Export PATH = <PATH >:$ PATH

However, the environment variables added by this method are temporary and will become invalid after the terminal is closed. If you want to save the PATH variable for a long time, you can modify/etc/profile (root permission is required for all users) # vim/etc/profile can also be changed under the home directory. bashrc file (do not have root permission, change for individual users) $ vim ~ /. Bashrc open the document and add the last line: export PATH = "<PATH>: $ PATH" to save and exit. Then run: source/etc/profile or source ~ /. Bashrc environment variable modified

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.