I’m trying to build an Oracle RAC system at work to understand how it works better. As part of this I had to build three Linux systems. I built one, then cloned it (it was a virtual machine in VMware).

But having done that, it of course kept the hostname of the first machine. So I had to work out how to change that.
It turns out that is quite easy.

Sometime when I’m working in UNIX I get lost in the maze of directories, and sometimes I can be working on a few different systems at the same time. So i find it very helpful to set an informative prompt.
The command below, when adding to your .bash_profile or .proifle will make your prompt look something like this:

user@host:/current/directiry>

Add this to you .bash_profile or .proifle file, logout and login again.

PS1='${LOGNAME}@${HOSTNAME}:${PWD}>'; export PS1

You may need to set the HOSTNAME environment variable for the hostname part to work, like this:
HOSTNAME=`hostname`; export HOSTNAME