Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Linux modify hostname command and operation example

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Today Xiaobian to share with you is Linux modify host name command and operation example, I believe many people do not know, in order to let everyone know more about Linux, so give you a summary of the following content, look down together. I'm sure you'll find something.

Linux Change Host Name Command

If you only need to change the hostname temporarily, you can use the hostname command.

sudo hostname #e.g. sudo hostname myDebian

This command does not change the static hostname in the/etc/hostname file, it only changes the transient hostname. So restarting the computer will revert to the old hostname.

2. If you want to permanently change the hostname, you can use the hostnamectl command or manually modify the/etc/hostname file using vim.

Command syntax is:

sudo hostnamectl set-hostname # sudo vim /etc/hostname

This command deletes the hostname from the/etc/hostname file and replaces it with a new hostname.

The above is the Linux host name modification command and operation example details, after reading whether there is any harvest? If you want to know more, welcome to the industry news!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report