jc
jc converts the output of many standard unix command line tools and file-types to dictionaries and lists of dictionaries.[1]
Documentation
- Documentation [EN]
Further Information
- Episode 341 - Long Term Rolling (18.02.2020) [EN] @ LINUX Unplugged
Syntax
COMMAND | jc [PARAMETER ...] PARSER
jc [PARAMETER ...] COMMAND
Parameters
- -p, --pretty
- Pretty format the JSON output.
- -q, --quiet
- Quiet mode. Suppresses parser warning messages.
- -r, --raw
- Raw output. Provides more literal output, typically with string values and no additional semantic processing.
- -y, --yaml-out
- YAML output
Examples
arp -a | jc --arp | jq 'del(.[].name, .[].permanent)'
Output:
[
{
"address": "10.0.0.1",
"hwtype": "ethernet",
"hwaddress": "0:0:5e:0:1:1",
"iface": "en9"
},
{
"address": "10.0.0.6",
"hwtype": "ethernet",
"hwaddress": "b8:69:f4:1:70:b1",
"iface": "en9"
}
]
References
- ↑ Repository contributors. "jc." GitHub. https://github.com/kellyjonbrazil/jc/tree/master/docs/ (accessed 05.05.2023)