Command prompt colours


Here’s an old trick which works great on ESX servers (thanks to this article on Linux Journal for reminding me).  It turns your prompt different colours to highlight when you are logged in as root.

To make the prompt red when you’re running as root add this to /root/.bashrc:

PS1='[e[31m]u@h:w#[e[m] ‘

To make the prompt green when running as a normal user add this to ~/.bashrc:

PS1='[e[32m]u@h:w$[e[m] ‘

Update: If you want to add this to a kickstart script, do this:

# Help identify when logged in as root
echo “PS1='[e[31m]u@h:w#[e[m]'” >> /root/.bashrc
echo “PS1='[e[32m]u@h:w#[e[m]'” >> /etc/skel/.bashrc

Shining glory

Here is version 1.1 in all its shining glory.

I’ve made several corrections (thanks everyone), added a few extra snippets and dusted it with a sprinkling of handy tips and tricks.

The biggest change is a small 3i section. I have been wanting to do this for a while, but I haven’t had a chance to play with it since its beta. There is quite lot of information around about 3i now, but I just wanted to add the sort of stuff people would actual use.

On a personal note, I have just got back from an OnTap foundations course, so I am try to pull together some good reading material for the NetApp NCDA. Maybe they’ll be a "vmreference OnTap card" soon:)

As ever, suggestions/advice/questions – get in touch