Archive for category Unix

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\]‘

, ,

Leave a Comment

Follow

Get every new post delivered to your Inbox.