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.. |
running
Code:
uname -n |
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 ;-) |
Just out of curiousity what do you mean by "reflect this on the screen immediately"?
|
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 .. |
All times are GMT -5. The time now is 06:15 PM. |