Fetching the key names from a JSON document using jq is simple! Get key names of JSON using jq Given a file named example.json, 1{ 2 "key": "value1", 3 "anotherKey": "value2", 4 "oneMoreKey": "value3" 5}extracting the keys in alphabetical order can be completed using: 1jq 'keys' example.jsonOutput: 1[ 2 "anotherKey", 3 "key", 4 "oneMoreKey" 5]Get key names of JSON unsorted using jq Taking the previous JSON document example.json, the keys may be returned in order as they appear: