jq Cheat Sheet/Raw string output

Print strings without JSON quotes.

Section: Getting Started

Raw string output

bash
bash
echo '{"name":"alice"}' | jq -r '.name'
Explanation

The `-r` flag is essential when you want shell-friendly plain text.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Getting Started
Pretty-print JSON from stdin
Format JSON read from stdin with default pretty output.
OpenIn sheetbashsame section
Read JSON file
Process a local JSON file.
OpenIn sheetbashsame section
Compact output
Emit compact JSON on one line per result.
OpenIn sheetbashsame section
Run jq without input
Create JSON from scratch using null input mode.
OpenIn sheetbashsame section
Disable color output
Print monochrome JSON for scripts or files.
OpenIn sheetbashsame section
Sort object keys
Output JSON with keys in sorted order.
OpenIn sheetbashsame section