Friday, March 16, 2007

This is my custom PS1 prompt for Solaris 10 UNIX

This is what I use for my root bash shell. There are many great tutorials out there, this isn't one of them. I'm just posting my own personal settings. If you have a better way, then by all means...

Change my default shell for root to bash
# usermod -s /bin/bash root

Create a .profile in roots home directory and add the following:
# ls -laih /.profile
(if none exists, then create it... If it does exist, then modify it)
# vi .profile
(add the line below)
export PS1="\e[0;34m[\u@\h]# \e[m"

The above line explained
\e[ <-- this starts the color scheme
0;34m <-- this says to color it blue
[\u@\h]# <-- this puts username@hostname, in brackets with the pound sign as the prompt
\e[m <-- this stops the color scheme

EDIT:
I almost forgot to add this:
List of Color codes
Color Code
Black 0;30
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33
Blue 0;34
Green 0;32
Cyan 0;36
Red 0;31
Purple 0;35
Brown 0;33

No comments: