Working with JSON in Zsh — jq Basics, Filters & Practical #22

21views
1likes
0
11:00
T
Taught by Celeste AI - AI Coding Coach
View on YouTube
Description
Learn how to work with JSON in Zsh using jq! This lesson covers pretty printing, extracting values with dot notation, array iteration, raw output, select and map for filtering, length, keys, array slicing, type checking, constructing new objects, string interpolation, sorting, and CSV output. 🔗 Source code: https://github.com/GoCelesteAI/zsh_working_with_json ⏱️ Timestamps: 0:00 — Intro 0:26 — jq Basics Explained 1:06 — jq Basics Demo 3:31 — Filtering & Transforming Explained 4:11 — Filtering & Transforming Demo 6:34 — Practical jq Explained 7:12 — Practical jq Demo 9:47 — Recap 10:29 — End 📋 Topics covered: • jq '.': pretty print JSON • jq '.key': extract a single field • jq '.[0]': access array element by index • jq '.[]': iterate over all array elements • jq '.a.b': access nested fields • jq -r: raw output without quotes • jq pipe |: chain multiple filters • select(): filter by condition • map(): transform every element • length: count array elements or object keys • keys: list top-level key names • .[:N]: array slicing • type: check JSON value type • {new: .old}: construct new objects • "\(.name)": string interpolation • sort_by(.field): sort by a field • reverse: reverse array order • @csv: output as CSV • [select()] | length: count filtered results 🎬 Part of the Zsh Shell Tutorial series — subscribe for weekly lessons! Tags zsh, zsh tutorial, jq, json, jq tutorial, json processing, command line json, jq select, jq map, jq filter, jq csv, shell scripting, command line, terminal, linux, macos, beginner programming, working with json, jq basics

Tags

zshzsh tutorialjqjsonjq tutorialjson processingcommand line jsonjq selectjq mapjq filterjq csvshell scriptingcommand lineterminallinux
Back to tutorials

Duration

11:00

Published

February 17, 2026

Added to Codegiz

March 15, 2026

Open in YouTube