title: Shell script to get the process ID on Linux
body: <p>I want to write a shell script (<code>.sh</code> file) to get a given process id. What I'm trying to do here is once I get the process ID, I want to kill that process. I'm running on Ubuntu (Linux).</p>
  
  <p>I was able to do it with a command like</p>
  
  <pre><code>ps -aux|grep ruby
  kill -9 &lt;pid&gt;
  </code></pre>
  
  <p>but I'm not sure how to do it through a shell script.</p>