Linux command
jtbl 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Display JSON as table
cat [data.json] | jtbl
Truncate long values
cat [data.json] | jtbl -t
No headers
cat [data.json] | jtbl -n
Markdown table
cat [data.json] | jtbl -m
Wrap long text
cat [data.json] | jtbl -w [80]
Rotate output
cat [data.json] | jtbl -r
说明
jtbl converts JSON to ASCII tables for terminal display. It formats JSON arrays as readable tables. The tool pairs well with jc for displaying command output. It supports Markdown output for documentation.
参数
- -t, --truncate
- Truncate long cell values to fit terminal width.
- -n, --no-headers
- Don't print column headers.
- -m, --markdown
- Output as a Markdown table.
- -c, --csv
- Output as CSV.
- -H, --html
- Output as an HTML table.
- -r, --rotate
- Rotate output so columns become rows (useful for wide tables).
- -w _COLS_, --wrap=_COLS_
- Wrap long cell values at the specified column count.
- -q, --quiet
- Suppress warning messages.
- -v, --version
- Show version.
- --help
- Display help information.
FAQ
What is the jtbl command used for?
jtbl converts JSON to ASCII tables for terminal display. It formats JSON arrays as readable tables. The tool pairs well with jc for displaying command output. It supports Markdown output for documentation.
How do I run a basic jtbl example?
Run `cat [data.json] | jtbl` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -t, --truncate do in jtbl?
Truncate long cell values to fit terminal width.