sudo apt install jq
Télécharger le fichier 64 bits ou 32 bits (à exécuter directement) à partir du site https://stedolan.github.io/jq/
jq '.' fichier.json
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
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