There are 5 1.2 bash (bourne-again Shell) profiles, 4 of which are in the user's home directory and one in/etc;
bash_history Operation history command to store files, only when logged off, the user logon process of the operation commands are written to the file, the logon process executed during the command, not immediately write to the file, but written in memory.
The. Bash_logout file executes every time the current user exits the shell, and if not specifically requested, the contents of the file are empty
The . Bash_profile is used to store shell information used by each user, and is often used to set environment variables to execute the user's. bashrc file; The following code is a root user's
#. bash_profile# Get the aliases and Functionsif [-f ~/.BASHRC]; Then . ~/.bashrcfi# User specific environment and startup Programspath= $PATH: $HOME/binexport PATH
The contents of the. bash_profile file can be seen from the code above, line 5th calls the./bashrc file in the user's home directory, line 10th sets the path system variable, and 12th lines the system variable export
The ./BASHRC contains information about bash that belongs to a user, and the following code is the. bashrc file content for a root user
#. bashrc# User specific aliases and Functionsalias rm= ' rm-i ' Alias cp= ' cp-i ' Alias mv= ' mv-i ' # Source Global Definitionsi f [-F/ETC/BASHRC]; Then ./etc/bashrcfiexport path=/usr/local/arm/4.3.2/bin: $PATH
From the above content, this file is mainly used to define aliases and functions, such as the 5th line defines the alias, and the 11th line also calls/ETC/BASHRC, line 14th also sets the path system variable
/ETC/BASHRC is very similar to the/etc/profile file in sh, which is a file that all users use together, and any user who logs on to bash will execute
Role:
1) Define PS1 (Command prompt) variable
2) Umask
3) define the PATH variable
4) Call the/etc/profile.d/*.sh file
Note: Linux does not recommend that users directly modify/etc/profile or/ETC/BASHRC files, should try to put the user's configuration in the user's home directory in the corresponding file
2. Command
3. Environment variable File Execution order
2. Shell's shell configuration file