LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-23-2006, 04:59 PM   #1
srns
LQ Newbie
 
Registered: Sep 2004
Posts: 29

Rep: Reputation: 15
Changing "hostname" without re-login or reboot


Guys,

How do I change the hostname without logout and a re-login?
I know if I call "hostname new_name", it gets updated..

Is there a way to reflect this on the screen immediately?

Thanks..
 
Old 01-23-2006, 10:37 PM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
running

Code:
uname -n
will return the hostname of your system. This is a quick and fast way to see if it has changed. Hope this helps. I'm not sure this is the answer to the question you are asking though.
 
Old 01-24-2006, 11:21 AM   #3
srns
LQ Newbie
 
Registered: Sep 2004
Posts: 29

Original Poster
Rep: Reputation: 15
If you just enter, "hostname" (without quotes), it will return the latest hostname..

Although it wasn't what I was looking for, thanks for your reply ;-)
 
Old 01-24-2006, 11:27 AM   #4
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
Just out of curiousity what do you mean by "reflect this on the screen immediately"?
 
Old 01-24-2006, 04:14 PM   #5
srns
LQ Newbie
 
Registered: Sep 2004
Posts: 29

Original Poster
Rep: Reputation: 15
OK..

old_name# hostname
old_name

old_name# hostname new_name

old_name# hostname
new_name

My original hostname is "old_name", and I modify it to "new_name" as in the 2nd command. Now, even though the hostname is "new_name", the prompt still says "old_name". (It becomes "new_name" after a re-login). But, I want it to become "new_name" immediately without a re-login.

Sorry for the confusion - I hope I'm clear ..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
"shutdown" and "halt" symlinks: poweroff, reboot. sud_crow Linux From Scratch 11 10-17-2006 11:03 PM
Can't run "halt" or "reboot" as user, can somebody help? ro_nicu Slackware 4 11-01-2004 07:57 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 03:28 PM
Howto disable "Graphical Login" or "Standard Login?" the_gripmaster Red Hat 1 07-08-2004 02:55 PM
Removing "shutdown" and "reboot" in logout window nearfar Red Hat 1 10-07-2003 11:33 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration