Archive for May, 2013

Favorite Linux Command Prompt

Love this command prompt on my Linux Systems.  Use it on both RedHat and Debian.  Feel free to tweak for your own use.  This is a compilation of several different ones I’ve seen and used over the years.

——————–

if [ $(id -u) -eq 0 ];
then # you are root, set red colour prompt
PS1=’\n\[\033[1;33m\] `/bin/cat /proc/loadavg | cut -d” ” -f-1`\[\033[0m\]\[\033[1;30m\] \d \t \[\033[0m\] \n\[\033[1;41m\] <location> \[\033[0m\] \[\033[1;31m\]\h:\[\033[0m\]\[\033[1;33m\]\w \[\033[1;32m\]#\[\033[0m\] ‘
else # normal
PS1=’\n\[\033[1;33m\] `/bin/cat /proc/loadavg | cut -d” ” -f-1`\[\033[0m\]\[\033[1;30m\] \d \t \[\033[0m\] \n\[\033[1;44m\] <location> \[\033[0m\] \[\033[1;36m\]\h:\[\033[0m\]\[\033[1;33m\]\w \[\033[1;32m\]#\[\033[0m\] ‘
fi

 

Share