This post will be very brief, but I want to show a little trick I'm using on my different servers so I can tell them apart at a glance. I use a custom bash prompt which gives the hostname of each server a different color:
[charles@alpha ~] $
[charles@beta ~] $
To set this up on your own servers, edit your .bashrc or .bash_profile which lives in your home directory. Add this at the bottom:
PS1='[\u@\[\e[1;33m\]\h\[\e[0m\] \W] $ '
The escape sequence \[\e[1;31m\] sets the color where the number before the 'm', 31, specifies the color (red in this case). The \[\e[0m\] resets the terminal to the normal display.
Check out http://wiki.archlinux.org/index.php/Color_Bash_Prompt for more examples.
Comments (0)
Commenting has been disabled for this entry
If you'd like to discuss an aspect of this post, feel free to contact me via email.