Created
June 18, 2014 16:39
-
-
Save virullius/da1c4f072c08a2ff0e19 to your computer and use it in GitHub Desktop.
Make hostname lowercase on linux
This file contains 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
# set hostname to lower in /etc/hosts file | |
sed -i "s/$(hostname)/$(hostname | tr '[:upper:]' '[:lower:]')/" /etc/hosts | |
# set runtime hostname to lowercase | |
hostname $(hostname | tr '[:upper:]' '[:lower:]') | |
# save lowercase hostname to /etc/hostname file | |
hostname > /etc/hostname |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment