Skip to content

Instantly share code, notes, and snippets.

@Grynn
Created February 3, 2023 10:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Grynn/c95025f8e0de103d962ed093b0d99a69 to your computer and use it in GitHub Desktop.
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
#!/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