Complete Reference with Copy-Paste Examples
Part of The Direct Path to Linux Ubuntu
— free for all students and developers.
JSON is the standard for REST APIs, configuration files, databases (MongoDB), and data exchange between any two systems or languages.
Every browser has JSON.parse() and JSON.stringify() built in — no libraries needed for basic JSON handling.
jq command-line tool processes JSON like awk processes text. JSON Schema validates data structure. Every language has JSON support.
npm packages, GitHub APIs, payment APIs (Stripe), cloud APIs (AWS, Azure), all use JSON — mastering it opens every door.
Run a JSON program:
# Process JSON on command line with jq: jq '.' file.json # pretty-print jq '.[].name' file.json # extract field jq 'select(.score > 90)' f.json # filter # Python: python3 -c "import json,sys; print(json.dumps(json.load(sys.stdin),indent=2))" # Or: python3 -m json.tool file.json # Validate JSON: jq empty file.json && echo "Valid" || echo "Invalid" python3 -m json.tool file.json > /dev/null && echo "Valid"