Linux, how to change hostname

I am using RHEL 6.2

My machine gives appearance of thinking its running in 2 different hostname

I see host01 in the following file


But when I do a hostname it says host2

What are all the files where the hostname

Is there a single command to change the host name (and hence all the files where the hostname is stored)
Los Angeles1Asked:
Who is Participating?
jgiordanoConnect With a Mentor Commented:
have you changed the name in network and not rebooted?

if you do a hostname <newname> that will change it for everyone logging on from that point forward. A reboot will take whats in /etc/sysconfig/network
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.