.bash_profile and .bashrc

.bash_profile and .bashrc

These file are loaded when you logon and is key for setting environment variables and or aliases.

Here are some examples

[oracle@vnl01 ~]$ cat .bashrc
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

# User specific aliases and function
alias osid=”echo $ORACLE_SID”
alias ohome=”echo $ORACLE_HOME”
alias obase=”echo $ORACLE_BASE”

[oracle@vnl01 ~]$ cat .bash_profile
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi

# User specific environment and startup programs

export ORACLE_SID=orcl
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
export PATH=$PATH:$HOME/bin:/$ORACLE_HOME/bin