cat test.json | jq -c '.[]' > testNDJSON.json
jq is a language that consists of filters on input data to convert it into a specific output
-c
:
By default, jq pretty-prints JSON output. Using this option will result in more compact output by instead putting each JSON object on a single line.
'.[]'
input
[{“name”:”JSON”, “good”:true}, {“name”:”XML”, “good”:false}]
Output
{“name”:”JSON”, “good”:true}{“name”:”XML”, “good”:false}
For more details and examples, you can find them at this manual.