From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search

User specific ~/.bashrc file for interactive bash shells. You can add your settings to this file. A sample file:

# ~/.bashrc: executed by bash(1) for non-login shells.
#export PS1='\h:\w\$ '
umask 022
# You may uncomment the following lines if you want `ls' to be colorized:
export LS_OPTIONS='--color=auto'
eval "`dircolors`"
alias ls='ls $LS_OPTIONS'
alias ll='ls $LS_OPTIONS -l'
alias l='ls $LS_OPTIONS -lA'
# Some more alias to avoid making mistakes:
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias egrep='egrep --color=auto'
alias fgrep='fgrep --color=auto'
alias grep='grep --color=auto'
alias dnstop='dnstop eth1'
alias vnstat='vnstat -i eth1'
alias vi='vim'
export PS1="[\u@\h \W]\\$ "
# Correct dir spellings
shopt -q -s cdspell
# Make sure display get updated when terminal window get resized
shopt -q -s checkwinsize
# Turn on the extended pattern matching features 
shopt -q -s extglob
# Append rather than overwrite history on exit
shopt -s histappend
# Make multi-line commandsline in history
shopt -q -s cmdhist 
# Get immediate notification of bacground job termination
set -o notify 
# Disable [CTRL-D] which is used to exit the shell
set -o ignoreeof

See also