title: Extract port number from netstat command
body: <p>I have the following output of the command netstat: </p>
  
  <pre><code>netstat -taunp | grep hgd
  tcp        0      0 10.1.1.1:601            10.1.1.2:935            ESTABLISHED 842/hgd
  tcp        0      0 10.1.1.1:55394          10.1.1.2:3490           ESTABLISHED 842/hgd
  </code></pre>
  
  <p>I want to extract from this output the port number <strong>601</strong>.
  please note that this port is random and port 935 is hard coded and exists in many netstat lines</p>
  
  <p>any suggestion?</p>