Change Hostname on Linux with CLI¶
1. Check your current hostname¶
Check what your current hostname is with hostnamectl or hostname command.

2. Change hostname¶
Change the hostname with hostnamectl command.
I want to change mine to lyn, so
3. Confirm change¶

4. (Optional) Set pretty hostname¶
A pretty hostname is the name displayed to the user, not the name used by other computers on a network. Computers identify each other using the static hostname.
To update the pretty hostname of a machine, you can use the hostnamectl command with the --pretty option.