Logo Pupungbp.com

Need a WordPress expert help?

How to change bash prompt color

Last Updated: September 30, 2014 | Reading Time: < 1 minute

A friend asked me about how to change bash’s prompt color after you logged in, regarding my previous post.

yellow

I utilize a bash PS1 generator, just play around with the options and copy the Result code into the clipboard.

bash-color

Next step, after you logged in, open with your favorite editor file named .bashrc:
[shell]
$ vi ~/.bashrc
[/shell]

Paste the Result code from the PS1 Generator:
[shell]
# Custom bash prompt via kirsle.net/wizards/ps1.html
export PS1="\[$(tput setaf 1)\]\u@\h:\[$(tput setaf 7)\]\W\\$ \[$(tput sgr0)\]"
[/shell]

then, execute bash to see the result:
[shell]
$ exec bash
[/shell]

All done. 🙂

Looking for an affordable WordPress solution?

We offer budget-friendly WordPress website development services to meet your needs. Prices start at $10.

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.