jq is great tool for JSON

For parse a large JSON file, I just found a great command line tool----jq.

Sometimes I just want extract a single item from JSON array and see structure. I have tried a lots of GUI tools e.g. VisualJSON or Jayson. There are work fine with small JSON files. If you drop a big file into it, app will stuck there.

jq did those things pretty damn good. For example, I can extract first item from JSON file in one line.

cat bigfile.json | jq '.[0]'

Even I can extract and transform into another JSON structure.

cat bigfile.json | jq '.[]|{message: .data.msg}'

Pretty easy, isn't?