.bashrc (Linux)
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User Prompt
export P=`hostname`"@"`echo $LOGNAME`
d=$(date +'%I:%M:%S %p')
PS1='
$PWD [\d - \D{%I:%M:%S %p}]
$P $ '
######### Environment Variables ###########
#### ORACLE #######
ORACLE_BASE=/opt/app/oracle/
ORACLE_HOME=$ORACLE_BASE/product/19.x/client_1; export ORACLE_HOME
LD_LIBRARY_PATH=$ORACLE_HOME/lib:${LD_LIBRARY_PATH} ; export LD_LIBRARY_PATH
PATH=$PATH:${ORACLE_HOME}/bin; export PATH
TNS_ADMIN=$ORACLE_HOME/network/admin; export TNS_ADMIN
### TMP ###
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR
## LINUX ##
export RESOLV_MULTI=off
alias getlibs="rpm -qa --qf '%{name}-%{version}-%{release}.%{arch}\n'|egrep 'compat|glibc|libstc|gcc|binutils|libaio|libstdc++|libgcc|libXext|libXtst|libXi|openmotif|redhat|sysstat|unix*|make|elfutils'|sort"
# Displays Directory Sizes in DESC
alias getds='for i in $(du -sk *|sort -nr|cut -f2); do du -sh $i; done 2>/dev/null'
alias rm='rm -i' # This avoids accidental deletion of any files/directories
alias getsysinfo='uname -an'
alias getbitsize='getconf LONG_BIT'
alias get2dayfile='ls -al --time-style=+%D | grep $(date +%D)'
alias get2fileonly='find $(pwd) -maxdepth 1 -type f -mtime -1'
alias get2dironly='find $(pwd) -maxdepth 1 -type d -mtime -1'
alias getsiebproc="top -n 1 -b -u appadmin|sed 's/^[ \t]*//;s/[ \t]*$//'"
alias getcpuinfo='lscpu'
alias lt='ls -lthra'
alias pss='ps -aef|egrep appadmin'
alias tops='top -u appadmin'
##################### FUNCTIONS #########################
## Find a File
function findfile()
{
find $(pwd) -name "$@";
}
## File Backup
function backup()
{
cp "$@" "$@"_$(date +'%b%d%Y_%I%M%p');
}
## Rename the file
function fileren()
{
mv "$@" "$@"_$(date +'%b%d%Y_%I%M%p');
}
## Directory Backup
function dirbackup()
{
cp -R "$@" "$@"_$(date +'%b%d%Y_%I%M%p');
}
Comments