title: How can I find the ports of a process (Java) in Linux even when the process is stopped
body: <p>How can I find the ports of a process in Linux? </p>
  
  <p>I tried:</p>
  
  <pre><code>netstat -a -p | grep'processID'
  </code></pre>
  
  <p>But if the process is not running, then there is no process ID and I am not able to get ports in this case. </p>
  
  <p>I am not running the process in any server, just a JVM instance which runs my Java process. </p>
  
  <p>Is there a way to find the port if its running, or will it be defined in any file then how to search?</p>