Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if [ -r ~/.profile ]; then . ~/.profile; fi
- case "$-" in *i*) if [ -r ~/.bashrc ]; then . ~/.bashrc; fi;; esac
- +----------------+-----------+-----------+------+
- | |Interactive|Interactive|Script|
- | |login |non-login | |
- +----------------+-----------+-----------+------+
- |/etc/profile | A | | |
- +----------------+-----------+-----------+------+
- |/etc/bash.bashrc| | A | |
- +----------------+-----------+-----------+------+
- |~/.bashrc | | B | |
- +----------------+-----------+-----------+------+
- |~/.bash_profile | B1 | | |
- +----------------+-----------+-----------+------+
- |~/.bash_login | B2 | | |
- +----------------+-----------+-----------+------+
- |~/.profile | B3 | | |
- +----------------+-----------+-----------+------+
- |BASH_ENV | | | A |
- +----------------+-----------+-----------+------+
- | | | | |
- +----------------+-----------+-----------+------+
- | | | | |
- +----------------+-----------+-----------+------+
- |~/.bash_logout | C | | |
- +----------------+-----------+-----------+------+
- # For BASH: Read down the appropriate column. Executes A, then B, then C, etc.
- # The B1, B2, B3 means it executes only the first of those files found. (A)
- # or (B2) means it is normally sourced by (read by and included in) the
- # primary file, in this case A or B2.
- #
- # +---------------------------------+-------+-----+------------+
- # | | Interactive | non-Inter. |
- # +---------------------------------+-------+-----+------------+
- # | | login | non-login |
- # +---------------------------------+-------+-----+------------+
- # | | | | |
- # | ALL USERS: | | | |
- # +---------------------------------+-------+-----+------------+
- # |BASH_ENV | | | A | not interactive or login
- # | | | | |
- # +---------------------------------+-------+-----+------------+
- # |/etc/profile | A | | | set PATH & PS1, & call following:
- # +---------------------------------+-------+-----+------------+
- # |/etc/bash.bashrc | (A) | A | | Better PS1 + command-not-found
- # +---------------------------------+-------+-----+------------+
- # |/etc/profile.d/bash_completion.sh| (A) | | |
- # +---------------------------------+-------+-----+------------+
- # |/etc/profile.d/vte-2.91.sh | (A) | | | Virt. Terminal Emulator
- # |/etc/profile.d/vte.sh | (A) | | |
- # +---------------------------------+-------+-----+------------+
- # | | | | |
- # | A SPECIFIC USER: | | | |
- # +---------------------------------+-------+-----+------------+
- # |~/.bash_profile (bash only) | B1 | | | (doesn't currently exist)
- # +---------------------------------+-------+-----+------------+
- # |~/.bash_login (bash only) | B2 | | | (didn't exist) **
- # +---------------------------------+-------+-----+------------+
- # |~/.profile (all shells) | B3 | | | (doesn't currently exist)
- # +---------------------------------+-------+-----+------------+
- # |~/.bashrc (bash only) | (B2) | B | | colorizes bash: su=red, other_users=green
- # +---------------------------------+-------+-----+------------+
- # | | | | |
- # +---------------------------------+-------+-----+------------+
- # |~/.bash_logout | C | | |
- # +---------------------------------+-------+-----+------------+
- #
- # ** (sources !/.bashrc to colorize login, for when booting into non-gui)
- # TIP: SEE TABLE in /etc/profile of BASH SETUP FILES AND THEIR LOAD SEQUENCE
- ssh fedora29
- └─ -bash # login shell
- ├── /etc/profile
- | ├─ /etc/profile.d/*.sh
- | ├─ /etc/profile.d/sh.local
- | └─ /etc/bashrc
- ├── ~/.bash_profile
- | └─ ~/.bashrc
- | └─ /etc/bashrc
- |
- |
- └─ $ bash # non-login shell
- └─ ~/.bashrc
- └─ /etc/bashrc
- └─ /etc/profile.d/*.sh
- ssh clearlinux
- └─ -bash # login shell
- ├── /usr/share/defaults/etc/profile
- | ├─ /usr/share/defaults/etc/profile.d/*
- | ├─ /etc/profile.d/*
- | └─ /etc/profile
- ├── ~/.bash_profile
- |
- |
- └─ $ bash # non-login shell
- ├─ /usr/share/defaults/etc/bash.bashrc
- | ├─ /usr/share/defaults/etc/profile
- | | ├─ /usr/share/defaults/etc/profile.d/*
- | | ├─ /etc/profile.d/*
- | | └─ /etc/profile
- | └─ /etc/profile
- └─ ~/.bashrc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement