Created
June 23, 2021 12:09
-
-
Save Sam-R/144a50b5d08caa40e74b4c801916bcbf to your computer and use it in GitHub Desktop.
Extract IPv4 addresses from /etc/hosts file
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
cat /etc/hosts | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | awk '{ print $1 }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment