Manikandan Manikandan - 1 year ago 89
JSON Question

What does jq '.' does?

How the jq '.' parsing the json and displaying ?

curl '' | jq '.'

I see the json is parsed and diplayed correctly

What is the implementation behind " xxxx | jq '.' "

How can i understand that ?

Answer Source

From the documentation:


The absolute simplest (and least interesting) filter is .. This is a filter that takes its input and produces it unchanged as output.

Since jq by default pretty-prints all output, this trivial program can be a useful way of formatting JSON output from, say, curl.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download