Outils pour utilisateurs

Outils du site


Action unknown: siteexport_addpage
all:bibles:linux:commandes:jq

json


jq

Installation

Package

sudo apt install jq

Exécutable indépendant

Télécharger le fichier 64 bits ou 32 bits (à exécuter directement) à partir du site https://stedolan.github.io/jq/

Utilisation

Affichage contenu fichier

jq '.' fichier.json

Accès propriété

Lecture de la donnée “toto” dans le fichier fichier.json

jq '.toto' fichier.json

Pour accéder au champ titi de la donnée toto :

jq '.toto.titi' fichier.json

Accès tableau

Interrogation de tous les tableaux :

jq '.[]' fichier.json

Interrogation du 2° tableau :

jq '.[1]' fichier.json

Interrogation propriété toto du premier tableau

jq '.[0].toto' fichier.json

Interrogation propriété toto de tous les tableaux :

jq '.[].toto' fichier.json

jo

JSON Crack

Validation

Sources

all/bibles/linux/commandes/jq.txt · Dernière modification : de omeylhoc