Linux command
fx 命令
文本
涉及管道、覆盖或删除,执行前请先确认路径和参数。
常用示例
Interactive JSON viewer
cat [data.json] | fx
Apply transformation
cat [data.json] | fx '.items'
Filter with expression
cat [data.json] | fx '.[] | select(.active)'
Select multiple fields
cat [data.json] | fx '.name' '.age'
Format output
cat [data.json] | fx .
说明
fx is a command-line JSON processing tool written in Go with interactive browsing. It provides jq-like filtering with its own expression syntax for flexible data manipulation. In interactive mode, fx provides a navigable tree view of JSON data. Expression mode allows piping data through transformations. Multiple expressions chain together. fx handles streaming JSON, object manipulation, and data extraction.
参数
- .
- Pretty print JSON.
- -r, --raw
- Output raw strings.
- -s, --slurp
- Read multiple JSON objects.
- --help
- Display help information.
FAQ
What is the fx command used for?
fx is a command-line JSON processing tool written in Go with interactive browsing. It provides jq-like filtering with its own expression syntax for flexible data manipulation. In interactive mode, fx provides a navigable tree view of JSON data. Expression mode allows piping data through transformations. Multiple expressions chain together. fx handles streaming JSON, object manipulation, and data extraction.
How do I run a basic fx example?
Run `cat [data.json] | fx` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does . do in fx?
Pretty print JSON.