Skip to content
Prev 1764 / 2152 Next

hostname on laptop

On Sep 1, 2013, at 9:41 AM, Michael Weylandt <michael.weylandt at gmail.com> wrote:

            
To be precise

uname -n

is what POSIX defines to be somewhat related to the question (BTW: this has nothing to do with the user or shell), but I'd guess that uname is rarely used for that purpose - the most commonly used tool for that purpose is probably

hostname

Speaking of shells - some systems/shells define the $HOSTNAME variable, but I would not rely on it since it doesn't change when switching networks.

Cheers,
Simon