Different color prompts for different machines when using terminal/ssh?
- by bcrawl
Hi,
I have 5 machines I constantly ssh into to do work. Its getting increasingly frustrating when I am issuing wrong commands on wrong boxes. Luckily I havent done anything bad yet. I wanted to know if there is any hack which I can hardcode which will display my prompt in different colors based on the machine I am ssh into? Such as blue for desktop1, purple for laptop, red for server etc? Is this possible?
Currently I am using this command export PS1="\e[0;31m[\u@\h \W]\$ \e[m " taken from here http://www.cyberciti.biz/faq/bash-shell-change-the-color-of-my-shell-prompt-under-linux-or-unix/ but it obviously doesnt work across ssh.
Also, if you have any other cool bash tips for helping me ease my sight will be wonderful. I got this tip which colors the man pages.
http://linuxtidbits.wordpress.com/2009/03/23/less-colors-for-man-pages/