How to change the computer name on Ubuntu

Today, I'd like to change my computer name that is too long on ubuntu.

Use "hostname" instruction to retrieve the compuer name

>> hostname
Dell-1545

Use "hostname dell-test" instruction to change the computer name temporarily. After restarting computer, its name will be restored.

>>hostname dell-test
dell-test

Actually, if want to change it permanently, you'd have to change it in "/etc/hostname" file. you can use the instructions to open it.

>>sudo vi /etc/hostname

Change it to one you want, and then reboot your system, it will be changed permanently.

posted on 2013-04-20 13:25  荡秋千  阅读(200)  评论(0编辑  收藏  举报