Nice terminal prompt

To change the terminal prompt to show current user, machine and current location (and a flashy green dot instead of normal hash symbol), put in .bashrc:

export PS1="\u@\h:\W`if [ $? = 0 ]; then echo -e '\[\e[01;32m\] #'; else echo -e '\[\e[01;31m\] #'; fi` \[\e[0m\]"

This was taken from really useful Xterm, Aterm and URXVT features (GNU Screen) in the Gentoo forums.

Note that I couldn't get xtermcontrol to work properly without it messing up runlevel 3 prompt (outside of xwindows), although I didn't really spend much time trying because I found the above code which achieved everythind I wanted from xtermcontrol.

Last modified: 07/05/06 20:02:22
Go to top

Related Pages

No related pages or links.

Login/out

Login

Forgot Password?
Go to top
Go to top