Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.