September 02, 2011

bash alias and colorful ls

Everything below should go under ~/.bashrc
alias la='ls -la'
alias gopen='gnome-open'
alias gterminal='gnome-terminal'
alias ls='ls --color'

PS1="\`if [ \$? = 0 ]; then echo \e[33\;40m\\\^\\\_\\\^\e[0m; else echo
\e[36\;40m\\\-\e[0m\\\_\e[36\;40m\\\-\e[0m; fi\` \w> "
NOTE: Make sure alias comes after PS1. PS1 is for cutom prompt.