在Ubuntu系统中,可以通过以下几种方法查看hostname:
hostnamectl命令Ctrl + Alt + T)。hostnamectl
Static hostname一行,显示的就是当前系统的hostname。/etc/hostname文件cat /etc/hostname
/etc/hosts文件cat /etc/hosts
127.0.0.1 localhost的行,紧随其后的就是hostname。hostname命令hostname
以上方法都可以帮助你查看Ubuntu系统的hostname。根据你的需求和习惯选择合适的方法即可。