Log-in Shell:
Login via terminal
Su-username
Non-logon Shell:
Su USERNAME (switch user with Su, without parameters)
Open Command Window under GUI
Shell scripts executed automatically (using at, crontab, Anacron, etc.)
Bash configuration file:
Global configuration:/ETC/PROFILE,/ETC/PROFILE.D/*.SH,/ETC/BASHRC
Personal configuration: ~/.BASH_PROFILE,~/.BASHRC
Profile class Files: Setting environment variables, running commands or scripts
BASHRC files: Setting local variables, defining command aliases
Log-in Shell:
Start Script load Order:/etc/profile---/etc/profile.d/*---~/.bash_profile---~/.BASHRC---/ETC/BASHRC
Note:/etc/profile is the first startup script that runs after the logon shell starts, and the non-logon shell does not use the script
The script for each call revokes the changes in the previous call script in turn,
You can use certain tasks such as creating an automatic backup, clearing temporary files to write to the ~/.bash_logout file to achieve the purpose of automatically performing related tasks each time you exit the login shell
Non-sign-on shell
Load startup script order: ~/.BASHRC-/ETC/BASHRC-/etc/profile.d/*
^_^
This article is from the "junight" blog, make sure to keep this source http://junight.blog.51cto.com/10828785/1728748
[Note] Login Shell vs. non-logon shell