bash shell colors

Anselm Strauss amsibamsi at
Thu Sep 18 06:56:14 UTC 2008


I use something like this (heavily inspired by Gentoo):

if [[ ${EUID} == 0 ]] ; then
   PS1='\[\033[01;31m\]\h\[\033[01;34m\] \W \$\[\033[00m\] '
   PS1='\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\] '

One could maybe also include a check of $TERM for different terminal  
types, not all of them will understand color escape sequences. And of  
course tools like ls and grep do colorized output themselves when  
called with appropriate options.

This is described in the PROMPTING section of Bash's manpage. I did  
not find any documentation for the exact codes for ANSI color escape  


On Sep 18, 2008, at 07:08 , Sam Fourman Jr. wrote:

> Hello list,
> I am looking to configure FreeBSD's Bash
> can anyone post a config file that would make FreeBSD's Bash shell
> color code like the default gentoo bash shell
> or if you have a config that you like and feel like posting it I will
> take a look at it.
> Sam Fourman Jr.
> Fourman Networks

More information about the freebsd-questions mailing list