| | 4 | |
| | 5 | When logging in to a Bash shell, the machine finds and executes commands in /etc/profile, and will then search for .bash_profile, .bash_login, and .profile (in that order) in the login user's home directory. When exiting / loggin out, bash reads and executes ~/.bash_logout (if it exists). |
| | 6 | |
| | 7 | (Will add more here...) |
| | 8 | |
| | 9 | === Tips and Tricks === |
| | 10 | |
| | 11 | I like to change the color, and structure, of my Bash prompt to make a more clear distinction between the area that I am typing and the prompt. A typical Bash prompt looks like {{{user@machine:present working directory$ }}}: |
| | 12 | |
| | 13 | === "Style" === |
| | 14 | |
| | 15 | I try to break up the content in my .bash_profile (for purely organizational reasons) into aliases, environment variables, and prompt manipulation. I store aliases in the file {{{.alias}}}, environment variables in {{{.env}}} and prompt manipulation in {{{.prompt}}}. In fact, my ~/.bash_profile really just looks like: |
| | 16 | {{{ |
| | 17 | if [ -f ~/.bashrc ]; then |
| | 18 | . ~/.bashrc |
| | 19 | fi |
| | 20 | |
| | 21 | source .env |
| | 22 | source .alias |
| | 23 | source .prompt |
| | 24 | }}} |
| | 25 | |
| | 26 | - Adrian |