LinuxCommandLibrary

jc

Convert command output to JSON

TLDR

View documentation for the JSON serializer

$ tldr jc.json
copy

View documentation for the autojump alias
$ tldr autojump
copy

SYNOPSIS

jc [OPTIONS] [PARSER [PARSER_ARGS] [FILE]]

PARAMETERS

-h, --help
    Show help message and exit

-q, --quiet
    Suppress all warnings

-r, --raw
    Raw JSON output (compact, no colors)

-p, --pretty
    Pretty print JSON output (default)

-a, --ascii
    Force ASCII output, no unicode

-m, --monochrome
    Disable colored output

-V, --version
    Show jc version and exit

-c, --csv
    CSV input mode

--lf2csv-line-end
    Use LF as CSV line end (Unix)

--pager
    Pipe output to pager if too long

--help-parser
    Show parser-specific help

DESCRIPTION

jc is a versatile command-line utility that parses the plain-text output of over 150 common Unix/Linux tools into structured JSON format. This enables easy processing with tools like jq, scripting languages, or databases, eliminating the need for brittle regex or awk parsing.

Simply pipe command output to jc with a parser name, e.g., ps aux | jc --ps or ls -l | jc --ls -p. It supports streaming for large datasets, handles multi-line outputs, and produces consistent schemas across systems. Global options control formatting, like pretty-printing (-p) or raw JSON (-r).

Ideal for automation, monitoring, DevOps, and data pipelines, jc reduces errors and improves portability. Install via pip install jc; parsers auto-update with the tool.

CAVEATS

Not installed by default; requires Python 3.6+. Some parsers may vary by OS/version. Use --quiet to suppress deprecation warnings.

COMMON USAGE EXAMPLES

ls -l | jc --ls
df -h | jc --df -p
ps aux | jc --ps | jq '.[] | select(.user=="root")'
jc --ip -a addr show

PARSER DISCOVERY

Run jc -h for full parser list. Use jc --help-ps for parser-specific options.

HISTORY

Developed by Kelly Brazil in 2018 as a Python project on GitHub. Reached 1.0 in 2020 with 100+ parsers; now at v2.x supporting 150+ tools. Actively maintained with community contributions.

SEE ALSO

jq(1), gron(1), awk(1), yq(1)

Copied to clipboard