2021-04-02 17:40:09 -07:00
.TH jc 1 2021 -04-02 1 .15.0 "JSON CLI output utility"
2020-07-13 07:18:48 -07:00
.SH NAME
jc \- JSONifies the output of many CLI tools and file-types
.SH SYNOPSIS
COMMAND | jc PARSER [OPTIONS]
or magic syntax:
jc [OPTIONS] COMMAND
.SH DESCRIPTION
jc JSONifies the output of many CLI tools and file-types for easier parsing in scripts. jc accepts piped input from STDIN and outputs a JSON representation of the previous command's output to STDOUT. Alternatively, the "magic" syntax can be used by prepending jc to the command to be converted. Options can be passed to jc immediately before the command is given. (Note: command aliases are not supported).
.SH OPTIONS
.B
Parsers:
.RS
2021-04-02 17:40:09 -07:00
.TP
.B
\fB --acpi\fP
acpi command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --airport\fP
2021-04-02 17:40:09 -07:00
airport -I command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --airport-s\fP
2021-04-02 17:40:09 -07:00
airport -s command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --arp\fP
arp command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --blkid\fP
blkid command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2021-01-05 13:58:38 -08:00
\fB --cksum\fP
2021-04-02 17:40:09 -07:00
cksum command parser
2021-01-05 13:58:38 -08:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --crontab\fP
crontab command and file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --crontab-u\fP
crontab file parser with user support
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --csv\fP
CSV file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2020-07-31 14:39:02 -07:00
\fB --date\fP
date command parser
2021-04-02 17:40:09 -07:00
2020-07-31 14:39:02 -07:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --df\fP
df command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --dig\fP
dig command parser
2021-04-02 17:40:09 -07:00
.TP
.B
\fB --dir\fP
dir command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --dmidecode\fP
dmidecode command parser
2021-04-02 17:40:09 -07:00
.TP
.B
\fB --dpkg-l\fP
dpkg -l command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --du\fP
du command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --env\fP
2021-04-02 17:40:09 -07:00
env command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --file\fP
file command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --free\fP
free command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --fstab\fP
fstab file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --group\fP
/etc/group file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --gshadow\fP
/etc/gshadow file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2021-02-09 16:03:00 -08:00
\fB --hash\fP
2021-04-02 17:40:09 -07:00
hash command parser
2021-02-09 16:03:00 -08:00
.TP
.B
\fB --hashsum\fP
2021-04-02 17:40:09 -07:00
hashsum command parser (md5sum, shasum, etc.)
2021-02-09 16:03:00 -08:00
.TP
.B
\fB --hciconfig\fP
hciconfig command parser
2021-04-02 17:40:09 -07:00
2021-02-09 16:03:00 -08:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --history\fP
history command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --hosts\fP
/etc/hosts file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --id\fP
id command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --ifconfig\fP
ifconfig command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --ini\fP
2020-07-31 12:58:11 -07:00
INI file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --iptables\fP
iptables command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2021-01-05 22:12:13 -08:00
\fB --iw-scan\fP
iw dev <device> scan command parser
2021-04-02 17:40:09 -07:00
2021-01-05 22:12:13 -08:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --jobs\fP
jobs command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2020-07-31 12:58:11 -07:00
\fB --kv\fP
Key/Value file parser
2021-04-02 17:40:09 -07:00
2020-07-31 12:58:11 -07:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --last\fP
last and lastb command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --ls\fP
2021-04-02 17:40:09 -07:00
ls command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --lsblk\fP
lsblk command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --lsmod\fP
lsmod command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --lsof\fP
lsof command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --mount\fP
mount command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --netstat\fP
netstat command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --ntpq\fP
2021-04-02 17:40:09 -07:00
ntpq -p command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --passwd\fP
/etc/passwd file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2020-07-20 16:25:20 -07:00
\fB --ping\fP
ping command parser
2021-04-02 17:40:09 -07:00
2020-07-20 16:25:20 -07:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --pip-list\fP
pip list command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --pip-show\fP
pip show command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --ps\fP
ps command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --route\fP
route command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --shadow\fP
/etc/shadow file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --ss\fP
ss command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --stat\fP
stat command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --sysctl\fP
sysctl command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --systemctl\fP
systemctl command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --systemctl-lj\fP
systemctl list-jobs command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --systemctl-ls\fP
systemctl list-sockets command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --systemctl-luf\fP
systemctl list-unit-files command parser
2021-04-02 17:40:09 -07:00
.TP
.B
\fB --time\fP
/usr/bin/time command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --timedatectl\fP
timedatectl status command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2020-07-27 19:02:11 -07:00
\fB --tracepath\fP
tracepath command parser
2021-04-02 17:40:09 -07:00
2020-07-27 19:02:11 -07:00
.TP
.B
2020-07-24 13:47:29 -07:00
\fB --traceroute\fP
traceroute command parser
2021-04-02 17:40:09 -07:00
2020-07-24 13:47:29 -07:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --uname\fP
2021-04-02 17:40:09 -07:00
uname -a command parser
.TP
.B
\fB --upower\fP
upower command parser
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --uptime\fP
uptime command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --w\fP
w command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
2021-01-05 13:58:38 -08:00
\fB --wc\fP
wc command parser
2021-04-02 17:40:09 -07:00
2021-01-05 13:58:38 -08:00
.TP
.B
2020-07-13 07:18:48 -07:00
\fB --who\fP
who command parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --xml\fP
XML file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB --yaml\fP
YAML file parser
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.RE
.PP
2021-04-02 17:40:09 -07:00
.B
2020-07-13 07:18:48 -07:00
Options:
.RS
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
.TP
.B
\fB -a\fP
about jc
.TP
.B
\fB -d\fP
debug - show traceback (\fB -dd\fP for verbose traceback)
.TP
.B
\fB -m\fP
monochrome output
.TP
.B
\fB -p\fP
pretty print output
.TP
.B
\fB -q\fP
quiet - suppress warnings
.TP
.B
\fB -r\fP
raw JSON output
.RE
.PP
2021-04-02 17:40:09 -07:00
.SH Example:
2020-07-13 07:18:48 -07:00
ls \fB -al\fP | jc \fB --ls\fP \fB -p\fP
2021-04-02 17:40:09 -07:00
2020-07-13 07:18:48 -07:00
or using the magic syntax:
2021-04-02 17:40:09 -07:00
jc \fB -p\fP ls \fB -al\fP