如何在Linux中改变主机名

194 阅读1分钟

要改变Linux计算机上的主机名,请使用hostnamectl 命令。

例如,要将你的计算机的主机名改为myhostname

$ sudo hostnamectl --static \--transient \--pretty \
myhostname