Bash Tip: Prompt Colors

Tip: Prompt magic

I came across this via a Gentoo thread, and after reading thoroughly got some pretty cool ideas.

Color was the wierdest thing to interpret without a key to work off of. So here it is!

my prompt:

export PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \n\[\033[00m\]\$ '

Which results in:

username@host ~/cwd
$

With green and blue colors.

VN:F [1.8.4_1055]
Rating: 0.0/10 (0 votes cast)
VN:F [1.8.4_1055]
Rating: 0 (from 0 votes)

Leave a Reply