9951 explained code solutions for 126 technologies


jqGet all keys of some command's json output


somecommand | jq 'keys | .[]'ctrl + c
somecommand

any command that has to output json, echo '{ "a": 1, "b": 2 }' for example

'keys | .[]'

keys of the object (not the values) as an array