Environment-how the environment is created-read the startup file

Source: Internet
Author: User
After you log on to the system, bash starts and reads a series of configuration scripts called Startup Files. These scripts define the default environment shared by all users

Introduction

After you log on to the system, bash starts and reads a series of configuration scripts called Startup Files. These scripts define the default environment shared by all users.

Next, bash will read more startup files stored in the main directory to define the personal environment.

The information about these steps is determined by the shell session type started.

========================================================== ======

Session Type: login and non-login

There are two types of shell sessions: login shell session and non-login shell session.

The login shell session prompts the user to enter the user name and password, such as the Virtual Console Session. The terminal we start in the GUI is a typical non-login shell.

Startup file read by login shell session

/Etc/profile

Global configuration scripts for all users

~ /. Bash_profile

User's personal startup file. Allows you to scale or override settings in the global configuration script.

~ /. Bash_login

 

~ /. Profile

 

Startup file read by non-login shell session

/Etc/bash. bashrc

Global configuration scripts for all users

~ /. Bashrc

The user's personal startup file. Allows you to scale or override settings in the global configuration script.

Description

In addition to reading the preceding startup file, the non-login shell session inherits the environment of the parent process. its parent process is usually a login shell session.

Related Article

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.