title: Using grep to filter process
body: <pre><code>root      1626     1  0 04:49 ?        00:00:00 /usr/sbin/sshd
  USERNAME    5133  5038  0 14:12 pts/0    00:00:00 /bin/bash ./find_proc.sh sshd
  USERNAME  5137  5133  0 14:12 pts/0    00:00:00 grep sshd
  </code></pre>
  
  <p>How can i use grep to filter out the bottom to processes? </p>
  
  <pre><code>ps -ef | grep "$1"  
  </code></pre>
  
  <p>is what gets me that output. I know you need to use grep -v to filter it out, however i am not sure of the order to do it in. It takes an Argument which is $1. So my input in the terminal is ./script_file sshd to get the output above. Any suggestions? </p>
  
  <pre><code>ps -ef | grep "$1" | grep -v grep  
  </code></pre>
  
  <p>gives me no output. </p>