Removing empty lines and duplicate lines from text file
<p>I recently used the awk command to remove duplicate lines, and spaces between lines but I am not getting the desired output file.</p>

<p>Input file:</p>

<pre><code>a b

a b

c d

c d

e f

e f
</code></pre>

<p>Desired output:(I wanted to remove duplicate lines and all spaces in between lines)</p>

<pre><code>a b
c d
e f
</code></pre>

<p>I used the following code:</p>

<pre><code>awk '!x[$0]++' input file &gt; output file
</code></pre>

<p>And got this output:</p>

<pre><code>a b

c d
e f
</code></pre>

<p>The space between the first line and all the rest is still in the output file.
Help please and thank you.</p>