Created
February 3, 2023 10:00
-
-
Save Grynn/c95025f8e0de103d962ed093b0d99a69 to your computer and use it in GitHub Desktop.
Get list of global IP addresses on a computer using ip2 command line
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
#!/bin/bash | |
set -eu -o pipefail | |
ip -j a | jq -r '.[] | .addr_info | map(select(.scope == "global")) | .[] | [ .family, .local ] | @csv' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment