title: union of two columns of a tsv file
body: <p>I've a file which stores a directed graph. Each line is represented as </p>
  
  <p>node1 TAB node2 TAB weight</p>
  
  <p>I want to find the set of nodes. Is there a better way of getting union? My current solution involves creating temporary files:</p>
  
  <pre><code>cut -f1 input_graph | sort | uniq &gt; nodes1
  cut -f2 input_graph | sort | uniq &gt; nodes2
  cat nodes1 nodes2 | sort | uniq &gt; nodes
  </code></pre>