iproute2 & systemd output in JSON format
TL;DR
Didn’t notice ip
provided by iproute2
supports output in JSON format until I read about the motivation behind jc
.
Example
1 | ip -j a | jq |
main()
Must have JSON CLI utils for more productivity:
jq
- who doesn’t know?sed
for JSON datagron
- makes JSON greppable. Super useful for people like me who cannot figure out thejq
filters by simply looking at JSON code, get enlightened bygron
andgron --ungron
.jc
- ideal forCOMMAND | jc PARSER [OPTIONS]
use cases
In addition to iproute2
, some systemd
provided *ctl
command supports JSON output format as well. Most commonly used ones
systemctl
journalctl
- …
Examples
1 | # systemctl status |
Have fun processing JSON with turbocharged productivity ;-)
EOF