title: Get all unique JSON key names with JQ
body: <p>Is there a way to get all unique key names, without invoking a unique sort outside <code>jq</code>?</p>
  <p>Example file:</p>
  <pre><code>{&quot;a&quot;: 1, &quot;b&quot;: 2, &quot;c&quot;: 3}
  {&quot;a&quot;: 4, &quot;b&quot;: 5, &quot;d&quot;: 6}
  </code></pre>
  <p>And <code>jq</code> and sort command as I use it now, but I think it's not so efficient:</p>
  <pre><code>jq -r keys[] example | sort -u                                                                               
  a                                                                                                                                       
  b                                                                                                                                       
  c                                                                                                                                       
  d     
  
       
  </code></pre>