This has been a post that I always wanted to write,(gimmicky!!)
Its always nice to have the work environment set up well/colorful..Makes me fell like working more..
This is not the case when it comes to Terminals(on solaris) Its always been plain black on white text/bg.The first thing I used to do was to change the settings to a white on black display however got bored by it over time and wanted to make it more appealing..And I changed the prompt to a colorful ‘Green’ with a few more details…
Getting down to it…
The syntax to change your PS1 is
\e[x;ym PS1 \e[m (looks ……….. ) Not really
- \e[ : start the color scheme syntax
- x;y : specify the color in combination
- PS1 : This will be your system prompt (That by default displays ‘bash#’)
- \e[m : endthe color scheme syntax
If you want to convert the prompt to ‘Green’ like I have then this is how the syntax will look,
Here is a list of all the color values.
NOTE: This change is not permanent, as soon as the session is ended you will lose it.
To make it permanent,go to ‘.bashrc’ file in the $HOME dir.(Usually if your the root user it will not be present,so create one and add the following lines to it)
export PS1=\e[x;ym PS1 \e[m
save and exit the file.The next time you run ‘bash’ you will see something like this.
NOTE 2: If you change the value of ‘x’ to 1 then you get a darker shade of the color you choose. I’ve also changed the PS1 to my liking…