My .bashrc
Cool stuff I like my bashrc to do for me. The full code is viewable after the jump.
- Grab aliases
- Make it so I can run
instead of
- Trim directory in bash prompt to the last level, meaning no directory info is shown.
- Erase duplicate commands from the history.
- Have my prompt look a certain way: CMD_NUM $> [input here].
- Have my history formatted so it displays date and time.
- And, if bashrc is being run in a visual shell, then do a silly little logo, that I stole from somewhere else on the internet. Why not?
1234567891011121314151617181920212223242526272829303132333435363738 | [ -z "$PS1" ] && return
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
export PATH=${PATH}:.
if [ ! -z "$TERM" ]; then
echo -e "\033[00;31m"
echo " .n . . n."
echo " . .dP dP 9b 9b. ."
echo " 4 qXb . dX Xb . dXp t"
echo "dX. 9Xb .dXb __ __ dXb. dXP .Xb"
echo "9XXb._ _.dXXXXb dXXXXbo. .odXXXXb dXXXXb._ _.dXXP"
echo " 9XXXXXXXXXXXXXXXXXXXVXXXXXXXXOo. .oOXXXXXXXXVXXXXXXXXXXXXXXXXXXXP"
echo " \`9XXXXXXXXXXXXXXXXXXXXX'~ ~\`OOO8b d8OOO'~ ~\`XXXXXXXXXXXXXXXXXXXXXP'"
echo " \`9XXXXXXXXXXXP' \`9XX' \`98v8P' \`XXP' \`9XXXXXXXXXXXP'"
echo " ~~~~~~~ 9X. .db|db. .XP ~~~~~~~"
echo " )b. .dbo.dP'\`v'\`9b.odb. .dX("
echo " ,dXXXXXXXXXXXb dXXXXXXXXXXXb."
echo " dXXXXXXXXXXXP' . \`9XXXXXXXXXXXb"
echo " dXXXXXXXXXXXXb d|b dXXXXXXXXXXXXb"
echo " 9XXb' \`XXXXXb.dX|Xb.dXXXXX' \`dXXP"
echo " \`' 9XXXXXX( )XXXXXXP \`'"
echo " XXXX X.\`v'.X XXXX"
echo " XP^X'\`b d'\`X^XX"
echo " X. 9 \` ' P )X"
echo " \`b \` ' d'"
echo -en "\033[00m"
fi
export PROMPT_DIRTRIM=1
export HISTCONTROL=erasedups
export PS1="\[\033[01;34m\]\! \[\033[01;32m\]\\$> \[\033[00m\]"
export HISTTIMEFORMAT='%F %T '
|
Ches Koblents
July 13, 2014