Last active
April 23, 2024 18:39
-
-
Save ryanmaclean/107cb7b7105fd20d2e87 to your computer and use it in GitHub Desktop.
Append or Replace /etc/hosts using Tee
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
#! /bin/bash | |
echo "127.0.0.1 localhost" | sudo tee --append /etc/hosts | |
echo "127.0.0.1" `ec2metadata --local-hostname` | sudo tee --append /etc/hosts | |
## Remove --append to overwrite the file |
SGmuwa
commented
Nov 27, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment