title: Get Top 20 IPs from access.log - sort by IP - add User Agent
body: <p>With this command it is possible to get the top 20 Ips from apache access.log</p>
  
  <pre><code>cat access_log | awk '{print $1}' | sort -n | uniq -c | sort -nr | head -20
  </code></pre>
  
  <p>I know, that User Agent could be displayed by:</p>
  
  <pre><code>awk -F\" '{print $6}'
  </code></pre>
  
  <p>or</p>
  
  <pre><code>cut -d\" -f 6
  </code></pre>
  
  <p>but how to combine this together?</p>
  
  <p>I want a <strong>sort by IP</strong> and append the user agent behind the IP.</p>
  
  <p>example:</p>
  
  <pre><code>544.45.234.5  Mozilla/5.0   (compatible;    bingbot/2.0;    +http://www.bing.com/bingbot.htm)
  </code></pre>