Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
jq 总是在每个字段之间产生带有换行符/返回的输出:
jq ... foo.json { "Name": "stedolan", "RecordTimestamp": "2021-02-25T05:00:06.740+0000" }
如何使每条记录输出一行,使其看起来像:
{"Name":"stedolan","RecordTimestamp":"2021-02-25T05:00:06.740+0000"}
jq 有一个选项:--compact-output
jq --compact-output ... foo.json {"Name":"stedolan","RecordTimestamp":"2021-02-25T05:00:06.740+0000"}
完整手册https://stedolan.github.io/jq/manual/v1.6/