在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。根據你的需求和習慣選擇合適的方法即可。