jc CLI output to JSON
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
jc <command> [args]
<command> | jc --<parser>
jc -p <command>
jc -y <command>
jc -hjc -h --<parser>
jc <command> | jq '.[]'
jc -r <command>
Concepts
- Command output ps, dig, ls, ...
- jc --<parser> or magic
- jq / script filter, select, format
Running jc
jc <command> [args]
<command> | jc --<parser>
cat <file> | jc --<parser>
jc /proc/<path>
jc <start>:<end> --<parser>
jc -s --<parser>
jc dig <host> | jq -r
'.[].answer[].data'
ps aux | jc --ps
Output options
jc -p <command>
jc -y <command>
jc -r <command>
jc -M <command>
jc -m <command>
jc -C <command> | less -R
jc -q <command>
jc -d <command>
jc -u --<parser>
JC_COLORS=<k>,<kw>,<n>,<s> jc -p
...
Common parsers
jc ps auxjc ls -l <dir>
jc df -hjc dig <host>
jc ss -tulpnjc ip routejc lsblkjc systemctl list-units
jc stat <file>
jc freejc uptimejc mountjc envjc netstat -anjc lsofjc ping -c 3 <host>
jc find <dir>
jc whoFile and string parsers
jc --csv < <file>.csv
jc --yaml < <file>.yml
jc --toml < <file>.toml
jc --ini < <file>.ini
jc --xml < <file>.xml
jc --kv < <file>
jc --jwt <<< <token>
jc --x509-cert < <cert>.pem
jc --asciitable < <table>.txt
jc --timestamp <<< <epoch>
jc --url <<< <url>
jc --ip-address <<< <ip>
jc --semver <<< <version>
jc --syslog < <file>
jc --git-logStreaming and help
<command> | jc --<parser>-s
ping <host> | jc --ping-s -u | jq .
jc -qq --<parser>-s
jc -hjc -hhjc -hhhjc -h --<parser>
jc -ajc -vjc -B | sudo tee /etc/bash_completion.d/jc
Custom parsers
| Platform | Path |
|---|---|
Linux |
~/.local/share/jc/jcparsers |
macOS |
~/Library/Application Support/jc/jcparsers |
Windows |
%LOCALAPPDATA%\jc\jc\jcparsers |
echo '<text>' | jc --<plugin>
Recipes
jc ps aux \ | jq -r 'sort_by(-.rss)[:5][] | "\(.rss) \(.command)"'
jc df | jq -r '.[] | select((."use%"|tonumber) > 80) | .mounted_on'
jc ss -tlnp \ | jq -r '.[] | "\(.local_port) \(.process_name)"'
jc systemctl --failed \ | jq -r '.[].unit'



