uname をつかう
hostname コマンドは、自ホスト名の変更する時にも使えるから、FQDN を表示しようとして hostname f
とかするとまいっちんぐなので、おっちょこちょいのひとは
uname -n
をつかうといいよ。
おまけ
ネットワークインタフェイスに割り当てられているIPアドレスを調べたい時の hostname コマンドは割と便利だ。
hostname -I
-I, --all-ip-addresses
Display all network addresses of the host. This option enumerates all configured addresses on all network interfaces.
The loopback interface and IPv6 link-local addresses are omitted. Contrary to option -i, this option does not depend on name resolution. Do not make any assumptions about the order of the output.
捗れ〜。