Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • 1
    Maybe you can use ip -j addr show eth0 | jq -c '.[].addr_info' | mlr --j2p unsparsify (or --j2t for JSON to TSV instead of to pretty) Commented Sep 10, 2024 at 15:31
  • See also ip -j addr show | jq -c '.[].addr_info' | vd -f json (vd can be found in the visidata package on Debian-based systems at least) Commented Sep 10, 2024 at 15:33
  • Are you on Linux? Can we assume GNU tools? Commented Sep 10, 2024 at 15:38
  • @terdon Yes, the systems in question are all Debian based (i.e. Raspbian, Ubuntu, Debian) Commented Sep 10, 2024 at 15:53
  • 1
    Extracting the keys could be simplified to ip -j a | jq -r '[.[].addr_info[]]|add|keys_unsorted' Commented Sep 10, 2024 at 16:18