# To set a hostname of a machine temporarily: sudo hostname # E.g. sudo hostname ubuntu # To set a permanent hostname (i.e. the hostname persists on reboot), # update the /etc/hostname file. sudo echo "" > /etc/hostname
# To set a hostname of a machine temporarily: sudo hostname # E.g. sudo hostname ubuntu # To set a permanent hostname (i.e. the hostname persists on reboot), # update the /etc/hostname file. sudo echo "" > /etc/hostname