Bash – How to Get a Colored Bash bashbashrccolorscommand line How can I get the bash to look colored like this? Best Answer Open ~/.bashrc in text editor and uncomment line: #force_color_prompt=yes to be: force_color_prompt=yes save then execute source ~/.bashrc Related SolutionsHow to Get Colored Output from Bash Script – Bash Scripting Guide Using the --color option works for me out when I run grep inside of shell scripts. Here is an example of what you want. grep -n --color=auto "PATTERN" FILE Bash Command Line – How to Edit Bash Prompt in Gnome Terminal Edit your ~/.bashrc file and add this at the end: function cfinfo(){ cf target | awk '$1=="Org:"{printf "%s-", $2} $1=="Space:"{print $2}' } That function generates the string IB-Production depending on the output of the command cf target -s production. Then add this after that function definition in ~/.bashrc: PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w \n $(cfinfo) \$ ' Notice: The part before $(cfinfo) differs in your case. In my example it is just the default uncolored debian prompt. Related QuestionHow to Get Colored Output from Bash Script – Bash Scripting GuideBash Command Line – How to Edit Bash Prompt in Gnome TerminalUbuntu – How to add colored git branch to the bash promptUbuntu – How to use the arrow sign in the bash prompt
Best Answer
Open
~/.bashrc
in text editor and uncomment line:#force_color_prompt=yes
to be:
force_color_prompt=yes
save then execute
source ~/.bashrc