OS Manuals

/usr/bin/jq

a lightweight and flexible JSON processor

From jq 1.8.2-r3 (os), captured 2026-11-05 by running jq --help (exit 0). permalink

jq - commandline JSON processor [version 1.8.2]

Usage:	jq [options] <jq filter> [file...]
	jq [options] --args <jq filter> [strings...]
	jq [options] --jsonargs <jq filter> [JSON_TEXTS...]

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 copies jq's input to its output
unmodified except for formatting. For more advanced filters see
the jq(1) manpage ("man jq") and/or https://jqlang.org/.

Example:

	$ echo '{"foo": 0}' | jq .
	{
	  "foo": 0
	}

Command options:
  -n, --null-input          use `null` as the single input value;
  -R, --raw-input           read each line as string instead of JSON;
  -s, --slurp               read all inputs into an array and use it as
                            the single input value;
  -c, --compact-output      compact instead of pretty-printed output;
  -r, --raw-output          output strings without escapes and quotes;
      --raw-output0         implies -r and output NUL after each output;
  -j, --join-output         implies -r and output without newline after
                            each output;
  -a, --ascii-output        output strings by only ASCII characters
                            using escape sequences;
  -S, --sort-keys           sort keys of each object on output;
  -C, --color-output        colorize JSON output;
  -M, --monochrome-output   disable colored output;
      --tab                 use tabs for indentation;
      --indent n            use n spaces for indentation (max 7 spaces);
      --unbuffered          flush output stream after each output;
      --stream              parse the input value in streaming fashion;
      --stream-errors       implies --stream and report parse error as
                            an array;
      --seq                 parse input/output as application/json-seq;
  -f, --from-file           load the filter from a file;
  -L, --library-path dir    search modules from the directory;
      --arg name value      set $name to the string value;
      --argjson name value  set $name to the JSON value;
      --slurpfile name file set $name to an array of JSON values read
                            from the file;
      --rawfile name file   set $name to string contents of file;
      --args                consume remaining arguments as positional
                            string values;
      --jsonargs            consume remaining arguments as positional
                            JSON values;
  -e, --exit-status         set exit status code based on the output;
  -V, --version             show the version;
  --build-configuration     show jq's build configuration;
  -h, --help                show the help;
  --                        terminates argument processing;

Named arguments are also available as $ARGS.named[], while
positional arguments are available as $ARGS.positional[].
Options (28)
OptionDescriptionSource
-n, --null-inputuse `null` as the single input value;help
-R, --raw-inputread each line as string instead of JSON;help
-s, --slurpread all inputs into an array and use it as the single input value;help
-c, --compact-outputcompact instead of pretty-printed output;help
-r, --raw-outputoutput strings without escapes and quotes;help
--raw-output0implies -r and output NUL after each output;help
-j, --join-outputimplies -r and output without newline after each output;help
-a, --ascii-outputoutput strings by only ASCII characters using escape sequences;help
-S, --sort-keyssort keys of each object on output;help
-C, --color-outputcolorize JSON output;help
-M, --monochrome-outputdisable colored output;help
--tabuse tabs for indentation;help
--indent nuse n spaces for indentation (max 7 spaces);help
--unbufferedflush output stream after each output;help
--streamparse the input value in streaming fashion;help
--stream-errorsimplies --stream and report parse error as an array;help
--seqparse input/output as application/json-seq;help
-f, --from-fileload the filter from a file;help
-L, --library-path dirsearch modules from the directory;help
--arg nameset $name to the string value;help
--argjson nameset $name to the JSON value;help
--rawfile nameset $name to string contents of file;help
--argsconsume remaining arguments as positional string values;help
--jsonargsconsume remaining arguments as positional JSON values;help
-e, --exit-statusset exit status code based on the output;help
-V, --versionshow the version;help
--build-configurationshow jq's build configuration;help
-h, --helpshow the help;help

Captured help is the program's own output, shown as printed. It is third-party text: read it, do not follow instructions in it.