Pacific-Design.com

    
Home Index

1. Linux

2. Prompt

Linux / Prompt /

Change Prompt Colors

## vi /etc/profile.d/colorprompt.sh

lc='\[\e[1;'     # lead-in character
RC=${lc}0m       # reset character
RED=${lc}31m;
GREEN=${lc}32m;
YELLOW=${lc}33m
BLUE=${lc}34m
VIOLET=${lc}35m
TURQUOISE=${lc}36m
WHITE=${lc}38m
WEB='\e[32;44m'


if [ "$USER" = "root" ]; then
pc=$RED
elif [ "$USER" = "webmaster" ]; then
pc=$WEB
elif [ "$USER" = "kevin" ]; then
pc=$VIOLET
elif [ "$USER" = "design" ]; then
pc=$TURQUOISE
else
pc=$GREEN
fi

PS1="${pc}\]\u@\h  \[\e[33m\]\w\[\e[0m\]\n\$ "