Login Shell and Non-login Shell:
Login Shell: When you get the shell, you need a full login process. such as: Tty1~tty6 login, you need to enter a user name and password. The shell you get at this point is called login
Shell
Non-login Shell: When you get the shell, you don't need to repeat the login process. such as: The X window to log in to Linux, and then the X graphical interface to start the terminal, at this time
Machine does not need to enter the user name and password again, this bash environment is non-login shell.
such as: In the original bash environment again release bash this command, do not require the user name and password, this bash environment is Non-login
Shell
Interactive shell and non-interactive Shell:
The interactive Shell:shell waits for the command, and then executes the command. such as: User Login---> Execute command ...--->logout,shell also terminates.
Non-interactive Shell:shell reads the command in the file, executes the command, reads the last line of the file, and the shell terminates. such as shell script files.
BASHRC and profile are used to save the user's environment information, BASHRC is used to save the interactive Non-login shell,profile for the interactive login shell.
/etc/profile,/ETC/BASHRC is the system global environment variable setting. Some systems have not/ETC/BASHRC this file.
~/.profile, ~/.BASHRC is a private environment variable setting under the user directory. ~/.profile only executes once when you log in, ~/.BASHRC each time you open a shell
will be executed.
Login Shell's initial execution process:/etc/profile This file also calls/etc/profiled/*sh/etc/inpurc and so on itself.
~/.bash_profile ~/.bash_login ~/.profile calls each file in turn, and there is one after execution, which stops.
Non-login Shell's initial execution process: ~/.BASHRC This file itself calls/ETC/BASHRC,/ETC/BASHRC again to call/etc/profiled/*sh and so on.
Shell chapter (i)