Didn’t notice ip provided by iproute2 supports output in JSON format until I read about the motivation behind jc.


ip -j a | jq
ip -j r | jq
ip -j -s link | jq


Must have JSON CLI utils for more productivity:

  • jq - who doesn’t know? sed for JSON data
  • gron - makes JSON greppable. Super useful for people like me who cannot figure out the jq filters by simply looking at JSON code, get enlightened by gron and gron --ungron.
  • jc - ideal for COMMAND | 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


# systemctl status
systemctl status sshd.service -o json
systemctl status -l sshd.service -o json

# journalctl
journalctl --since yesterday --output json

Have fun processing JSON with turbocharged productivity ;-)