Colored prompt on bash console

It can be nice to have different colorĀ  prompt on the terminal screen to differentiate different login. the following code simply set up PS1 to have yellow prompt on the terminal screen, which can be appended in your .bash_profile

# set our custom yellow prompt
PS1=’\[33[1;33m\]\u\[33[1;37m\]@\[33[1;33m\]\h\[33[1;37m\]:\[33[1;33m\]\W \[33[1;33m\]\$ \[33[0m\]‘

# set our custom red prompt to visually identified root
PS1=’\[33[1;31m\]\u\[33[1;37m\]@\[33[1;31m\]\h\[33[1;31m\]:\[33[1;31m\]\W \[33[1;31m\]\$ \[33[0m\]‘

, ,

  1. Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.