Adding Pythonpath methods to Linux and modifying environment variable methods

Source: Internet
Author: User

There are three ways to set environment variables under Linux, one for the current terminal, one for the current user and one for all users:

One: For the current terminal:

In the current terminal, enter:

Export path= $PATH:< your path to join >

However, the method above applies only to the current terminal and is not valid once the current terminal is closed or in another terminal.

Export ndk_root=/home/jiang/soft/android-ndk-r8e #只能在当前终端使用.

Two: For the current User:

There is a. bashrc hidden file in the user's home directory, and you can include the PATH in this file with the following settings:

Gedit ~/.BASHRC

Join:

Export path=< your path to join;: $PATH

If you want to add more than one path, simply:

Export path=< The path you want to join 1>:< the path you want to join 2>.: $PATH

Each path is separated by a colon.

This will take effect every time you log in

This is also the way to add Pythonpath, which is added in. BASHRC

After saving, enter $ source ~/.BASHRC in the terminal to make the environment variable effective immediately

Three: For all users: 

Join:

Export path=< The path you want to join;: $PATH

You can do it.

Terminal input: Echo $PATH can view environment variables

  

 

Adding Pythonpath methods to Linux and modifying environment variable methods

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.