Last active
January 17, 2023 07:17
-
-
Save justinmarwad/af5931004889399139469a047498b18e to your computer and use it in GitHub Desktop.
Change hostname on Linux (Ubuntu 22.04 tested) in single bash command
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export OLDHOST="ubuntu-server"; export NEWHOST="K"; sudo sed -i 's/$OLDHOST/$NEWHOST/g' /etc/hosts; sudo hostnamectl set-hostname $NEWHOST |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment