MoonPoint Support Logo


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals

Advanced Search
Sun Mon Tue Wed Thu Fri Sat

Sun, Mar 06, 2016 9:55 pm

Viewing and setting the host name on a Linux or OS X system

To view the host name for a Linux or OS X system you are logged into, you can use the uname command with the -n option. On a Linux system, you can also use --nodename in lieu of -n, but --nodename won't work on OS X. If the host name has not been set, you will see localhost.localdomain displayed.
$ uname --nodename

You can also use the hostname command on a Linux or OS X system to show or set the host name. To show the host name, issue the command without any parameters

$ hostname

On some versions of Linux, e.g., CentOS and Ubuntu, you can also view the host name using the sysctl command; it won't work on OS X, however.

[ More Info ]

[/os/unix] permanent link

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo