Linux Shell startup configuration file Settings

Source: Internet
Author: User

Installation of a software, the final generated report, requires "to start using the EGSNRC system, activate your current configuration

By adding the following lines to your favorite shell resource file: "

At first I didn't understand what the shell resource file meant. Later the search found that the original environment variable configuration file.

The startup of each shell, the mechanism for executing commands and programs, how to handle the input and output of commands and programs, and any programming are affected by certain environment variable settings. Each system has an initial system boot file, usually/etc/ Profile. This file contains the initial settings for important environment variables that work for the shell and some other utilities. There are also some hidden files and point files in the specific shell that are executed when you start the shell, which is also called the Shell's startup file. Typically a user's home directory, ~/.profile, or a profile or login file for a particular shell. For example, Bash's profile Han 蚻 ogin file is usually ~/.bash_profile and ~/.bash_login.

When you start a bash, the order in which the configuration files are called:

/etc/profile (for all users).

Then all of the files in THE/ETC/PROFILE.D directory.

Then ~/.bash_profile, ~/.bash_login, ~/.profile.

Then ~/.BASHRC.

When login bash exits, it executes the commands in the ~/.bash_logout file.

/etc/profile.d/is used to store different application configuration files.

For example, I always use SSH for CVS (cf. RSH). So I use:

echo "Export Cvs_rsh=ssh" >>/etc/profile.d/cvs.sh

chmod +x/etc/profile.d/cvs.sh

Create a new configuration file, put the required statements into it, and then log in again, ok!

When you start an interactive bash, it executes the commands in the ~/.BASHRC file (if the file exists and is readable). When you start non-interactively to run a shell script, bash looks for the BASH_ENV environment to determine the name of the execution file.

If you are using a TC Shell, it executes the command in the/ETC/CSH.CSHRC or etc/.chsrc file (if the file exists and is readable). Log in to the shell and execute the command in the/etc/csh.login file (if the file exists and is readable). Then execute the command in the ~/.TCSHRC file (if ~/.TCSHRC does not exist, which is the ~/.CSHRC file) and read the contents of the ~/.history file. The login shell executes the commands in the ~/.login and ~/.cshdirs files.

When a TC shell exits, it executes the commands in the/etc/csh.logout and ~/.login files (if the file exists and is readable).

Linux Shell startup configuration file Settings

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.