Linux see. bash_pfofile, Bash_logout and. BASHRC Introduction

Source: Internet
Author: User
Tags svn egrep

. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.