~/.bashrc

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

You can use ~/.bashrc for Customize the bash shell environments.

Sample ~/.bashrc file

# .bashrc
# User specific aliases and functions
 
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias vi='vim'
alias grep='grep --color'
alias update='yum update'
alias updatey='yum -y update'
alias dnstop='dnstop -l 5  eth2'
alias vnstat='vnstat -i eth2'
alias bc='bc -l'
 
xrpm() { [ "$1" != "" ] && (rpm2cpio "$1" | cpio -idmv) }
 
genpasswd() { 
	local l=$1
       	[ "$l" == "" ] && l=16
      	tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs 
}
 
# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

See also