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.
Asked
Active
Viewed 7,777 times
14
-
Yes you can.See this link – karthick87 Nov 18 '10 at 19:31
3 Answers
29
Found an easy way to do it:
Uncomment force_color_prompt=yes
in ~/.bashrc
.

Olivier Lalonde
- 58,691
-
1
-
I absolutely overlooked this option in the ~/.bashrc! Thanx anyways! – Ubuntuser May 04 '11 at 10:54
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:
- Click on the download link on the website
- get the deb for Ubuntu
- 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 :-)