title: Sort uniq IP address in from Apache log
body: <p>I'm trying to extract IP addresses from my apache log, count them, and sort them.</p>
  
  <p>And for whatever reason, the sorting part is horrible.</p>
  
  <p>Here is the command:</p>
  
  <pre><code>cat access.* | awk '{ print $1 }' | sort | uniq -c | sort -n
  </code></pre>
  
  <p>Output example:</p>
  
  <pre><code>  16789 65.X.X.X
    19448 65.X.X.X
     1995 138.X.X.X
     2407 213.X.X.X
     2728 213.X.X.X
     5478 188.X.X.X
     6496 176.X.X.X
    11332 130.X.X.X
  </code></pre>
  
  <p>I don't understand why these values aren't really sorted. I've also tried to remove blanks at the start of the line (<code>sed 's/^[\t ]*//g'</code>) and using <code>sort -n -t" " -k1</code>, which doesn't change anything.</p>
  
  <p>Any hint ?</p>