linux-environment variable Configuration

Source: Internet
Author: User

All Users:
/etc/profile

This file sets the environment information for each user for the system, which is executed when the user logs on for the first time.

and collect the shell settings from the configuration file of the /etc/profile.d directory.

  /ETC/BASHRC

Execute this file for each user running the bash shell. When the bash shell is opened, the file is read.

Current User:
  ~/.bash_profile

Each user can use the file to enter shell information dedicated to their own use, and when the user logs in, the
The file is only executed once! By default, he sets some environment variables to execute the user's. bashrc file.
  ~/.BASHRC

This file contains bash information dedicated to your bash shell, and when you log in and each time you open a new shell, the
The file is read.

~/.bash_logout   executes the file each time it exits the system (exiting the bash shell).

  bash_profile ,. BASHRC ,bash_logout

the above three files are the user Environment profile for the bash shell, which is located in the user's home directory. . Bash_profile   Is the most important configuration file that is read every time a user logs on to the system, and all commands inside it are executed by bash

  . BASHRC

The file is read when the bash shell invokes another Bashshell, which is the file that is read when the Bash command is typed in the shell to launch a new shell. This effectively separates the environments required for logins and child shells. But in general, it will be called in. bash_profile. BASHRC scripts for unified configuration of user environments.

. Bash_logout   is read when exiting the shell. So we can put some clean-up orders into this file. when you log on to Linux, the order of execution is: ~/.bash_profile, ~/.bash_login, ~/.profileif the ~/.bash_profile file exists, the ~/.BASHRC file is typically executed

linux-environment variable Configuration

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.