. bash_profile file
. Bash_profile is the most important file that is read every time a user logs on to the system and contains commands that are executed by bash.
This file defines the basic environment for a user's login account: including path paths and some alias alias settings.
If you change the contents of your. bash_profile file, the change will not take effect until you exit and log on again and the file is re-read. If you are impatient, use source. Bash_profile to make the changes take effect immediately.
My personal. bash_profile file is configured as follows:
The code is as follows |
Copy Code |
Ps1= ' ${debian_chroot:+ ($debian _chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ ' #PS1 = ' ${debian_chroot:+ ($debian _chroot)}u@h:w$ ' Ps1= "[e]0;${debian_chroot:+ ($debian _chroot)}u@h:wa] $PS 1" Export PS1 Export pager=less Export Blocksize=k Export Histfile=~/.bash_history Export RSYNC_RSH=SSH Export Phpadmin_home= $HOME/htdocs/phpmyadmin Export Oauth_home= $HOME/htdocs/oauth Alias ls= ' ls--color=auto ' alias ll= ' Ls-lga ' alias vdiff= ' vim + ' Dirdiff ' alias grep= ' grep--color=auto ' br> alias fgrep= ' Fgrep--color=auto ' alias egrep= ' egrep--color=auto ' alias rm= ' Rm-i ' alias mv= ' Mv-i ' Al IAS cp= ' cp-i ' alias sco= ' SVN co ' alias sci= ' svn ci-m ' alias sup= ' svn up ' alias st= ' svn St ' Alias kg= ' qpkg info ' alias aconf= ' pushd.; Cd/usr/local/apache2/conf/include ' alias alog= ' pushd.; cd/usr/local/apach E2/logs ' alias abin= ' pushd.; Cd/usr/local/apache2/bin ' alias bk= ' popd ' alias his= ' history ' alias Hisgre p= ' History | grep ' . bashrc file |
The above describes. Bash_profile, so what's BASHRC doing? The
. bash_profile file is read and executed only by the login shell, that is, if your initial shell is Cshell. Then when you execute bash and switch to the bash environment, the. Bash_profile is not read. The. bashrc file is read at this time.
Bash
. bash_logout file
This file is the least I can change because it's almost impossible to use. The
. bash_logout file is read and executed every time the login shell exits.
This file provides the ability to customize the user environment. That is, if you perform commands such as deleting temporary files in an account or recording the time spent in the login system, you can put these commands in. Bash_logtou.
If the file does not exist, no more commands will be executed when exiting