Setting up BASH Environment

Medical Technology, Healthcare & Government IT

.
Categories
Category Groups

BASH and Environment Setup

Standard directory colors:

echo "DIR 01;33 # directory" >> $HOME/.dircolors

Standard command prompt:

PS1="\n\[\033[1;32m\]\[email protected]\h\[\033[0m\]:\[\033[1;33m\]\w\[\033[0m\] \n-> "

Add your terminal type ($TERM) to set color_prompt in .bashrc:

# look for something like this and add "linux" to it
case "$TERM" in
    xterm-color) color_prompt=yes;;
    linux) color_prompt=yes;;
esac
# If this is an xterm set the title to [email protected]:dir
case "$TERM" in
xterm*|rxvt*|linux)
    PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\[email protected]\h: \w\a\]$PS1"
    ;;
*)
    ;;
esac
Original Link

Leave a Reply