Login Shells Read the following startup file:
File |
Content |
| /etc/profile |
Global profiles that are open to all users |
| ~/.bash_profile |
A user's personal startup file, which can be used as a personal global setting |
| ~/.bash_login |
Assumptions ~/.bash_profile not found. Then bash tries to read the script |
| ~/.profile |
Suppose these two files ~/.bash_profile, ~/.bash_login can not be found. Bash to take this file, this is a default file |
Note:
- Export path= $PATH:d irectory #仅仅改变当下bash的环境配置, Invalid next login
- source. Bash_profile #改变全局变量, make it effective with source
- . Bash_logout #退出时, the script does the operation, say emptying etc.
The Non-login shell reads the following files:
File |
Content |
| /etc/bash.bashrc |
Global profiles that are open to all users |
| ~/.bashrc |
A user's personal startup file, which can be used as a personal global setting |
Be able to look at 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
Copyright notice: This article Bo Master original articles, blogs, without consent may not be reproduced.
Bash multiple profiles are typically used to