মূল বিষয়বস্তুতে যান
kitlocal.dev

jq চিটশিট

লোকালি চলে

১০০% আপনার ব্রাউজারে প্রসেস হয়। ইনপুট ও আউটপুট কখনো আপনার ডিভাইস ছেড়ে যায় না।

jq 1.8-এর সাথে যাচাইকৃত jq JSON প্রসেসর ফিল্টার, পাইপ, অবজেক্ট গঠন, অ্যারে, select, map, group_by, reduce এবং CLI ফ্ল্যাগ।

যেভাবে কাজ করে

Every jq filter transforms an input JSON stream into zero or more output JSON values. Dot (`.`) is the identity filter; pipes (`|`) pass each output of the left filter into the right filter, and `.[]` explodes an array or object into a stream of items so you can filter, map and re-wrap them with `[...]`.

সারভাইভাল কিট

যে কয়েকটি কমান্ড সবার আগে শিখতে হবে।

৪০টি কমান্ড

কীবোর্ড শর্টকাট/সার্চে ফোকাস করুনJKনির্বাচন সরানCনির্বাচিতটি কপি করুনFনির্বাচিতটি বুকমার্ক করুনEscসার্চ মুছুন

Inspect & format JSON

Start with `.` to validate and pretty-print JSON, or `-r`/`-c` to adapt formatting for downstream tools.

অফিসিয়াল ডকুমেন্টেশন: Invoking jq
  • অপরিহার্য

    Validate and pretty-print JSON with syntax highlighting.

    jq . <file.json>

    কখন ব্যবহার করবেন

    Quickly format minified API responses or confirm JSON syntax from the terminal.

    বিশ্লেষণ

    .
    identity filter: passes the whole JSON value unchanged

    উদাহরণ

    echo '{"b":2,"a":1}' | jq -c .

    ফলাফল

    {"b":2,"a":1}

    বিকল্প উপায়

    • jq -S . <file.json> (sort object keys alphabetically)

    আরও দেখুন

Access fields & arrays

Chain property names with `.a.b`, index arrays with `.[0]`, and append `?` to skip missing/null errors.

অফিসিয়াল ডকুমেন্টেশন: Basic filters

Filter & transform

Combine `select(cond)` to drop items and `map(...)` or `[...]` to transform the remaining ones.

অফিসিয়াল ডকুমেন্টেশন: Builtin operators & functions

Sort, group & aggregate

Group records by a key, deduplicate, compute totals, or flatten nested arrays.

অফিসিয়াল ডকুমেন্টেশন: Sorting and grouping

CLI variables, CSV & shell interop

Pass shell parameters safely with `--arg` / `--argjson` and export tables directly with `@csv` or `@tsv`.

অফিসিয়াল ডকুমেন্টেশন: Format strings and escaping

KitLocal টুলে এটি চেষ্টা করে দেখুন

শব্দকোষ
Filter
An expression in jq that takes a JSON value and outputs zero or more values.
Stream
Multiple values produced by `.[]` or `,` before wrapping back into an array with `[...]`.
Raw output (-r)
Outputs strings without JSON surrounding quotes — essential when feeding bash or grep.
Compact (-c)
Prints each JSON object on a single line (NDJSON / JSON Lines).

১৫ নভে, ২০২৬ তারিখে যাচাইকৃত · jq 1.8-এর বিপরীতে যাচাইকৃত

উৎস: jq Manual (jqlang.org)

অ্যাঙ্গেল ব্র্যাকেটের ভেতরের অংশগুলো আপনার নিজস্ব মান দিয়ে প্রতিস্থাপন করুন। কমান্ডগুলো অফিসিয়াল ডকুমেন্টেশন থেকে নেওয়া হয়েছে এবং প্রদর্শিত সংস্করণে উদাহরণগুলো পরীক্ষা করা হয়েছে।