Is there a way to get all unique key names without causing a unique view outside jq?
file example:
{"a": 1, "b": 2, "c": 3}
{"a": 4, "b": 5, "d": 6}
Both jq and the sort command, as I am using it now, but I think it is not so efficient:
jq -r keys[] example | sort -u
a
b
c
d
source
share