14

Is it possible to color the prompt ("user@host:~/dir/$") in Bash? Some commands generate a lot of output and it's sometimes hard to find where it started. Coloring would help a lot.

3 Answers3

29

Found an easy way to do it:

Uncomment force_color_prompt=yes in ~/.bashrc.

0

A catch-all alternative to the other solutions:

if [ $(which dircolors) ]
then
  if [ -r ~/.dircolors ]
  then
    eval "$(dircolors -b ~/.dircolors)"
  else
    eval "$(dircolors -b)"
  fi
  export color_support=true
fi

Additionally, you could enable colors in common commands such as ls and grep.

if [ "$color_support" = true ]
then
  alias ls="ls --color=auto"
  alias grep="grep --color=auto"
fi
0

Bashish is a theme engine for the console; check some screen shots here :-)

It's easy to install:

  1. Click on the download link on the website
  2. get the deb for Ubuntu
  3. double-click the downloaded file and Software center will install it for you.

After that, close any open terminals and type:

bashish list

to get a list of already built themes.

Have fun :-)

Fabby
  • 34,259
Pitto
  • 1,938