JQ Tool: Difference between revisions

From Chorke Wiki
Jump to navigation Jump to search
Line 65: Line 65:
* [https://medium.com/how-tos-for-coders/https-medium-com-how-tos-for-coders-parse-json-data-using-jq-and-curl-from-command-line-5aa8a05cd79b Parse JSON data using JQ Tool]
* [https://medium.com/how-tos-for-coders/https-medium-com-how-tos-for-coders-parse-json-data-using-jq-and-curl-from-command-line-5aa8a05cd79b Parse JSON data using JQ Tool]
* [https://stackoverflow.com/questions/42716734/ JSON file in-place using <code>jq</code>]
* [https://stackoverflow.com/questions/42716734/ JSON file in-place using <code>jq</code>]
* [https://kislyuk.github.io/yq/ YQ Tool]
* [https://stedolan.github.io/jq/ JQ Tool]
* [https://stedolan.github.io/jq/ JQ Tool]



Revision as of 22:26, 7 July 2023

ubuntu:
sudo apt update
sudo apt list --upgradable

sudo apt upgrade
sudo apt install jq 
sudo apt --fix-broken install
windows:
1. Press ⊞ + R
2. Type in PowerShell
run as administrator user
3. Press Ctrl + Shift + Enter
4. Choose Yes and Press Enter
5. chocolatey install jq
macos:



brew doctor
brew update
brew install jq

Knowledge

(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '.'
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '.page|keys'
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '.page|keys[]'
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '.page|length'
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '{page: .page}'
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '.status|keys[]'
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq --raw-output '.page.updated_at' 
(curl -s https://www.githubstatus.com/api/v2/status.json)|jq '.status.indicator,.page.updated_at'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '.features |length'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '.features[0:1][0].properties |keys'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '{type: .type , features: .features}'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.pop_est]|min'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.pop_est]|max'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.economy]|unique'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.economy]|unique[]'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.pop_est]|sort'
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.pop_est]|sort[]'|head
(curl -s 'https://raw.githubusercontent.com/datasets/geo-boundaries-world-110m/master/countries.geojson')|jq '[.features[].properties.pop_est]|sort[]'|tail

References