The Perfect BASH Linux Prompt

In my never ending search for the perfect bash Linux prompt, I have found this:

if [[ ${EUID} == 0 ]] ; then
PS1='\[\033[01m\][ \[\033[01;31m\]\u@$(hostname -d) \[\033[00m\]\[\033[01m\]] \[\033[01;32m\]\w\[\033[00m\]\[\033[01;31m\]$\[\033[00m\]> '
else
PS1='\[\033[01m\][ \[\033[01;34m\]\u@$(hostname -d) \[\033[00m\]\[\033[01m\]] \[\033[01;32m\]\w\[\033[00m\]\[\033[01;34m\]$\[\033[00m\]> '
fi

I wanted to show my domain name instead of my server’s name.

Add this to the bottom of your /etc/bashrc for all logins or your individual .bashrc for a nicely formatted linux prompt showing your domain (instead of your server’s hostname).