在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。根据你的需求和习惯选择合适的方法即可。