LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

hostid

displays the current host's unique identifier as a 32-bit hexadecimal value

TLDR

Display the host ID
$ hostid
copy
Show version
$ hostid --version
copy
Show help
$ hostid --help
copy

SYNOPSIS

hostid [option]

DESCRIPTION

hostid displays the current host's unique identifier as a 32-bit hexadecimal value. If /etc/hostid exists, the value stored there is printed; otherwise it is derived from the machine's hostname and IP address via the gethostid(3) function. The identifier was historically used by software licensing schemes and is largely a legacy feature on modern Linux systems.

PARAMETERS

--help

Display help and exit.
--version
Display version and exit.

INSTALL

sudo apt install coreutils
copy
sudo dnf install coreutils
copy
sudo pacman -S coreutils
copy
sudo apk add coreutils
copy
sudo zypper install coreutils
copy
brew install coreutils
copy
nix profile install nixpkgs#coreutils
copy

CAVEATS

The value is not guaranteed to be unique across machines, particularly when derived from a hostname rather than a fixed /etc/hostid file. It has no security value and should not be relied on as a hardware fingerprint.

SEE ALSO

hostname(1), uname(1)

RESOURCES

Copied to clipboard
Kai