title: Using bash ps and cut together
body: <p>I need to extract PID, UID and command fields from 'ps' and I have tried it like this:</p>
  
  <p><code>ps -L u n | cut -f 1,2,13</code></p>
  
  <p>For some reason, this behaves as there is no cut command whatsoever. It just returns normal ps output. Then, I tried </p>
  
  <p><code>ps -L u n | tr -s " " | cut -d " " -f 1,2,13</code> and this returns total nonsense. Then, I tried playing with it and with this:</p>
  
  <p><code>ps -L u n | tr -s " " | cut -d " " -f 2,3,14</code> </p>
  
  <p>and this somehow returns what I need (almost, and I don't understand why that almost works), except that it cuts out the command field in the middle of it. How can I get what I need?</p>