Unix Bash Coloured Prompts
| Posted by watashii | Filed under UnixTo display coloured prompts upon user login (on Unix Bash shell, PuTTY client), perform the following modifications:
- Unix login and open the user’s profile in the home directory, eg /home/username/.profile
- In the .profile, add the following entry in a new line to execute the bash shell upon login, eg /usr/bin/bash
- The bash shell will refer to a .bashrc file. If its not there, create it, eg /home/username/.bashrc
- Add following entries in the .bashrc to enable the coloured prompt; showing the username, hostname and working directory:
# Colored Prompts
STARTGREEN='\[\e[0;32m\]';
STARTBLUE='\[\e[1;34m\]';
ENDCOLOR="\[\e[0m\]";
PS1="$STARTGREEN\u@\h$ENDCOLOR:$STARTBLUE\w$ENDCOLOR $ ";
