title: How to get PID and Port # for a Jenkins Process
body: <p>I need to get PID &amp; Port# for a Jenkins process run. If i get that PID, i can kill the process if ever i need to. </p>
  
  <p>I am running the Jenkins process by below commands:</p>
  
  <pre><code>java -jar jenkins.war 
  </code></pre>
  
  <p>Sometimes, Jenkins Process fail to start if that port is taken and below occurs:</p>
  
  <pre><code>Jenkins home directory: /Users/MacPro/.jenkins found at: $user.home/.jenkins
  Feb 27, 2016 10:46:09 AM org.eclipse.jetty.util.log.JavaUtilLog warn
  WARNING: FAILED 
  SelectChannelConnector@0.0.0.0:8080:java.net.BindException: 
  Address already in use
  java.net.BindException: Address already in use
  </code></pre>
  
  <p>And I know how to run the jenkins process against a specific Port#.</p>
  
  <p>Need to know the commands for which PID and the port, current job is using.</p>