Friday, May 7, 2010

Ubuntu :: Prompt :: Color

Edit file
$ vim ~/.bashrc

Type in the values below
RS="\[\033[0m\]"    # reset
HC="\[\033[1m\]"    # hicolor
FRED="\[\033[31m\]" # foreground red
FBLK="\[\033[30m\]" # foreground black
FMAG="\[\033[35m\]" # foreground magenta

Edit this line:
PS1="${debian_chroot:+($debian_chroot)}\u@\h:\w\$"
and modify it to
PS1="$HC${debian_chroot:+($debian_chroot)}$FRED\u$FBLK@$FMAG\h$FBLK:$FRED\W$FBLK\$ $RS"

Old prompt
username@hostname:~/path/to/dir$

New prompt
username@hostname:dir$

No comments:

Post a Comment