Ubuntu set hostname permanently (computer name) command

Originally published at: https://www.cyberciti.biz/faq/ubuntu-set-hostname-permanently-computer-name-command/

I am a new Ubuntu Linux server user. My server is running on AWS cloud. By default they set my VM name to ‘ip-172-26-12-173’ during creation of VM but now I would like to change the computer name to ‘wsl-us-west2-www1’. How do I set hostname permanently on Ubuntu Linux 18.04 LTS? Can you tell me…

Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki