Several common configuration files in Bash
Login shells reads the following Startup file:
File |
Content |
/Etc/profile |
Global configuration files open to all users |
~ /. Bash_profile |
A user's personal Startup file can be used as a personal global setting |
~ /. Bash_login |
If~ /. Bash_profileBash tries to read the script if it cannot be found. |
~ /. Profile |
If the two files~ /. Bash_profile, ~ /. Bash_loginBash reads this file. This is the default file. |
NOTE:
- Export PATH = $ PATH: directory # only change the current bash environment configuration. The next logon is invalid.
- Source. bash_profile # change the global variable and use source to make it take effect.
- . Bash_logout # The operations performed by the script, such as clearing, when exiting
Non-login shell reads the following files:
File |
Content |
/Etc/bash. bashrc |
Global configuration files open to all users |
~ /. Bashrc |
A user's personal Startup file can be used as a personal global setting |
You can see the. bash_profile script content:
# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ]; then. ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/binexport PATH
Bash script 15-minute advanced tutorial
Job control instances of Bash and KSH shell in 10 Linux/Unix
Abnormal shell script running in Ubuntu: difference between Bash and dash
Bash script for statement if statement and various test statements
What is the Bash Shell build in command?
This article permanently updates the link address: