jq - commandline JSON processor
Usage: jq [options] <jq filter> [file...]
jq is a tool for processing JSON inputs, applying the given filter to its JSON text inputs and producing the filter's results as JSON on standard output.
The simplest filter is ., which is the identity filter, copying jq's input to its output unmodified (except for formatting).
For more advanced filters see the jq(1) manpage ("man jq") and/or https://stedolan.github.io/jq
Some of the options include:
-ccompact instead of pretty-printed output;-nusenullas the single input value;-eset the exit status code based on the output;-sread (slurp) all inputs into an array; apply filter to it;-routput raw strings, not JSON texts;-Rread raw strings, not JSON texts;-Ccolorize JSON;-Mmonochrome (don't colorize JSON);-Ssort keys of objects on output;--tabuse tabs for indentation;--argavset variable$ato value<v>;--argjsonavset variable$ato JSON value<v>;--slurpfileafset variable$ato an array of JSON texts read from<f>;
Examples
jq -r '.version' #obtener el propiedad version de un json pasado como parametro