title: How to generate list of unique lines in text file using a Linux shell script?
body: <p>Suppose I have a file that contain a bunch of lines, some repeating:</p>
  
  <pre><code>line1
  line1
  line1
  line2
  line3
  line3
  line3
  </code></pre>
  
  <p>What linux command(s) should I use to generate a list of unique lines:</p>
  
  <pre><code>line1
  line2
  line3
  </code></pre>
  
  <p>Does this change if the file is unsorted, i.e. repeating lines may not be in blocks?</p>