Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using Fedora 14 and I changed my hostname in /etc/sysconfig/network and by using the hostname command. The shell prompts correctly display the new hostname. However the terminal titles still display the old hostname. I've tried setting the $HOSTNAME variable to the new hostname using export HOSTNAME=newhostname but it works only in the current terminal session. When I open a new terminal and type echo $HOSTNAME it displays the old one. Is there a way to change $HOSTNAME for all shells without rebooting or logging out? I've tried source /etc/profile and that does not work.

share|improve this question

You can't do anything that would push out a environmental variable to already running shells.

So you options are to either start new shells, or do something in each shell that is already running to take the new environmental variable.

The easiest way would be to export the new variable in each shell:

export HOSTNAME=mynewhostname

Replacing 'mynewhostname' with your new hostname.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .