Linux Basics-Read the configuration file order when a user logs on

Source: Internet
Author: User

Linux under All files, at the login will also follow the login to read many configuration files. Learn some information before you introduce the reading order.

Shell type for user login

Log-in Shell

Log in normally via a terminal

Su-username

Su-l USERNAME

Non-sign-on shell

Shell in the following way

Su USERNAME

Terminal window opened by graphical terminal

Shell scripts that are executed automatically


Bash's configuration file

Global configuration file

/etc/profice,/etc/profile.d/*.sh,/etc/bashrc

User Personal Profile

~/.bash_profile,~/.bashrc


Profile type file function:

Setting environment variables

Run a command or script when a user logs on

Files of the BASHRC class:

Setting Local Variables

Defining command aliases


Logon Shell reads the order of configuration files at logon

/etc/profile--/etc/profile.d/*.sh--and ~/.bash_profile--~/.BASHRC--/ETC/BASHRC


The non-logon shell reads the configuration file in the order

~/.BASHRC--/ETC/BASHRC-/etc/profile.d/*.sh


Therefore, when you need to modify variables or aliases, you can modify different configuration files according to the order in which they are read.

Note: The current shell will not be affected when the second modification affects only the future login shell



This article from "Liang Childe" blog, please be sure to keep this source http://iyull.blog.51cto.com/4664834/1883446

Linux Basics-Read the configuration file order when a user logs on

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.