Sunday, October 17, 2010

Colorful BASH prompt: How to display BASH prompt with multiple colors

Add this line to the .bashrc

PS1='\[$(tput bold)$(tput setb 4)$(tput setaf 7)\]\u@\h:\w $ \[$(tput sgr0)\] '


More references:

http://wiki.archlinux.org/index.php/Color_Bash_Prompt
http://www.systhread.net/texts/200703bashish.php
http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/
http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/

No comments:

Post a Comment