在Ubuntu系统中,可以通过以下几种方法来查看hostname:
hostnamectl命令hostnamectl
/etc/hostname文件cat /etc/hostname
/etc/hosts文件cat /etc/hosts
localhost相关的行,通常会显示为127.0.0.1 localhost <hostname>,其中<hostname>就是你的系统hostname。hostname命令hostname
以上方法都可以帮助你查看Ubuntu系统的hostname。选择一种你觉得最方便的方法即可。