# jq

> jq is a command line JSON processor that filters, transforms and formats the output of APIs and CLIs such as the AWS CLI and kubectl.

- Source: https://www.itwonderlab.com/jq/
- Published: 2026-09-30
- Updated: 2026-09-30
- Author: Javier Ruiz Jiménez (https://www.javierruizjimenez.com/)
- Site: IT Wonder Lab (https://www.itwonderlab.com/)

---

**jq** reads JSON on its input and applies a filter, like `sed` for JSON. It is the quickest way to extract an instance id from `aws ec2 describe-instances` or a field from `kubectl get -o json`.

### Key concepts

- **Filter**: `.items[].metadata.name`.
- **Pipe**, **select**, **map**: compose filters.
- **-r**: print raw strings without quotes.

### Learn it

Follow the [jq cheat sheet for the AWS CLI and kubectl](https://www.itwonderlab.com/jq-cheat-sheet-aws-cli-kubectl/).
