I tried the fish shell, and love the fact that it does syntax colouring in the shell itself: fish syntax colouring

Is there some way to do this in bash?

  • 3
    I think you have to actually modify the Bash code in order to do that. – sparticvs Dec 13 '13 at 16:10

Real time syntax coloring is a lot of work, especially with shells whose syntax is trickier than fish's. Only fish has it out of the box.

Zsh has syntax coloring if you install the zsh-syntax-highlighting add-on.

I'm not aware of any effort to do this with bash.


You can edit the bash.bashrc file in the /etc directory. You will want to change $PS1 (primary shell prompt) and maybe $PS2 (secondary shell prompt).

Check out this link for the how-to, it helped me set mine: https://help.ubuntu.com/community/CustomizingBashPrompt

  • 2
    The question is more generic then just prompting. – Karlson Dec 13 '13 at 18:01
  • I have already customized the heck out of $PS1 and $PS2 ;) – MadTux Dec 13 '13 at 18:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.