title: Get the username and the process ID of a process in bash
body: <p>I am writing a bash script where I need to find out the userID of a process. For an example let the process be bash itself.</p>
  
  <p>I tried <code>ps aux | grep ba[s]h</code> but the following was returned:</p>
  
  <pre><code>1000      2745  0.0  0.1  28360  5440 pts/1    Ss   10:11   0:01 bash
  </code></pre>
  
  <p>I see the userID 1000 displayed, but I want the username.</p>