Skip to content

Instantly share code, notes, and snippets.

@major
Created July 12, 2013 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save major/5985773 to your computer and use it in GitHub Desktop.
Save major/5985773 to your computer and use it in GitHub Desktop.
I had no idea that hostnamectl was a thing until today.
[root@localhost ~]# hostnamectl
Static hostname: db1
Icon name: computer-vm
Chassis: vm
Machine ID: 2943f0a6e8260542b59535a148fe8041
Boot ID: b1df3ce3fc5b495a8e7d611c66d13935
Virtualization: kvm
Operating System: Fedora 19 (Schrödinger’s Cat)
CPE OS Name: cpe:/o:fedoraproject:fedora:19
Kernel: Linux 3.9.5-301.fc19.x86_64
Architecture: x86_64
[root@localhost ~]# hostnamectl --help
hostnamectl [OPTIONS...] COMMAND ...
Query or change system hostname.
-h --help Show this help
--version Show package version
--transient Only set transient hostname
--static Only set static hostname
--pretty Only set pretty hostname
--no-ask-password Do not prompt for password
-H --host=[USER@]HOST Operate on remote host
Commands:
status Show current hostname settings
set-hostname NAME Set system hostname
set-icon-name NAME Set icon name for host
set-chassis NAME Set chassis type for host
@srgvg
Copy link

srgvg commented Jul 12, 2013

Seems to be a systemd utility, installed on my ubuntu, not sure of that is by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment