Ubuntu – Change Hostname Permanently Using the Command Line | Michael Lane's Blog: "#!/bin/bash
#Assign existing hostname to $hostn
hostn=$(cat /etc/hostname)
#Display existing hostname
echo "Existing hostname is $hostn"
#Ask for new hostname $newhost
echo "Enter new hostname: "
read newhost
#change hostname in /etc/hosts & /etc/hostname
sudo sed -i "s/$hostn/$newhost/g" /etc/hosts
sudo sed -i "s/$hostn/$newhost/g" /etc/hostname
#display new hostname
echo "Your new hostname is $newhost"
#Press a key to reboot
read -s -n 1 -p "Press any key to reboot"
sudo reboot"
https://pricklytech.wordpress.com/2013/04/24/ubuntu-change-hostname-permanently-using-the-command-line/
'via Blog this'
Blog Archive
-
▼
2015
(226)
-
▼
April
(19)
- T400 mic not working - Lenovo Community
- Robots Bring Couple Together, Engagement Ensues - ...
- Audacity label format
- NICT - Top page | NICT-National Institute of Infor...
- 国内基金业绩亮瞎眼。。。小小试水。。 - 未名空间(mitbbs.com)
- 关于CS,一些你不知道的东西(附加一些东西让准备转专业的人看 - 未名空间(mitbbs.com)
- 2015年度苏州高新区科技创新创业领军人才计划申报公告-首页-中国驻旧金山总领馆教育组
- LIUM Speaker Diarization Wiki [i-vector]
- userguide LIA_SpkDe
- new trick tmux
- 10次左右独立引用, 语音识别研究员NSC中心EB-1B获批! - 未名空间(mitbbs.com)
- Writing shell scripts - Lesson 13: Positional Para...
- 大数据在工业界流行的黑暗真相 - 未名空间(mitbbs.com)
- CHANGE HOSTNAME PERMANENTLY USING THE COMMAND LINE
- How to install Teamviewer on 14.04?
- Snapchat年薪百万招聘毕业生 - 未名空间(mitbbs.com) - 海外华人第一门户
- LDL Cholesterol: The Test
- Speech Signal Processing Toolkit (SPTK)
- GMM on Hadoop
-
▼
April
(19)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment