Ubuntu Set shell environment variables

Source: Internet
Author: User
Keywords Ubuntu Environment variables
Tags aliyun configuration environment environment variables etc export file files

Ubuntu Set shell environment variables

To open a configuration file:

Vim ~/.BASHRC

At the end of the file, add the following

Export variable name = variable

As:
Export Java_home=/usr/lib/jvm/java-6-sun
Export path= $PATH: ~/mybin

Log off and log on again, and the new environment variable takes effect.

There are several files in the http://www.aliyun.com/zixun/aggregation/13835.html ">ubuntu" that can set environment variables
 
/etc/profile: The first file that is used when the operating system customizes the user's environment at logon, which sets the environment information for each user of the system, and when the user first logs on, the file is executed.
 
/etc/environment: The second file that is used by the operating system at logon, the system sets the environment variable for the environment file before reading your own profile.
 
~/.profile: The third file that you use when you log on IS. Profile files, which each user can use to enter shell information dedicated to their own use, which is executed only once when the user logs on! By default, he sets some environment variables to execute the user's. BASHRC files.
 
/ETC/BASHRC: This file is executed for each user running the bash shell. When the bash shell is opened, the file is read.
 
~/.BASHRC: This file contains bash information dedicated to your bash shell, which is read when you log in and each time you open a new shell.

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.