📜  shell 配置文件 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:49:50.380000             🧑  作者: Mango

代码示例1
# There are the following initialization files for bash shells:

$ /etc/profile
      # The systemwide initialization file, executed for login shells
$ /etc/bash.bashrc
      # The systemwide per-interactive-shell startup file
$ /etc/bash.bash.logout
      # The systemwide login shell cleanup file, executed when a login shell exits
$ ~/.bash_profile
      # The personal initialization file, executed for login shells
$ ~/.bashrc
      # The individual per-interactive-shell startup file
$ ~/.bash_logout
      # The individual login shell cleanup file, executed when a login shell exits
$ ~/.inputrc
      # Individual readline initialization file

# Purpose

# system-wide defaults for..
    1. /etc/profile ..login shells, for interactive shells with login
    2. /etc/bashrc ..non-login Bash shells
    
# user-specific defaults in home directory ~ for..
    1. ~/.profile ..login shells, called after login
    2. ~/.bashrc ..non-login shells, if already logged in
    3. ~/.bash_profile ..login shells, called after login (lower priority)

# user-specific defaults in home directory for login and logout
    1. ~/.bash_login ..login shells (called upon login)
    2. ~/.bash_logout ..login shells (called upon logout)