$ cat somefile { "field": { "entry1": 12, "entry2": 42, "entry3": 8, } } Retrieve keys of an object and return them as an array: $ <somefile jq '.field | to_entries[] | .key' "entry1" "entry2" "entry3"