title: How to parse netstat command in order to get process name and PID from it?
body: <p>I'm trying to determine what application is using certain port and get <code>netstat -tlnp | grep &lt;port&gt; for Linux</code>.</p>
  
  <p>This command return the following output:</p>
  
  <pre><code>(Not all processes could be identified, non-owned process info will not be shown, you would have to be root to see it all.)  
  tcp  0  0 0.0.0.0:&lt;port&gt;  0.0.0.0:*  LISTEN  3591/java
  </code></pre>
  
  <p>I need to get in result only name of the process and PID, i.e java 3591.</p>
  
  <p>What is best way to do it?</p>
  
  <p>Thank you.</p>