title: pgrep command not returning PID
body: <p>I am trying to find the PID of a process (motion_sensor.py), but pgrep returns nothing. Why does it not return the process id?</p>
  
  <pre><code>pgrep -u www-data motion_sensor.py
  </code></pre>
  
  <p>ps -ef | grep "motion_sensor" returns</p>
  
  <pre><code>root      7149     1 93 Apr25 ?        15:59:08 python motion_sensor.py
  www-data 31872 23531  0 14:09 ?        00:00:00 sh -c sudo python /home/pi/Desktop/PiControl/motion_sensor.py
  root     31873 31872  0 14:09 ?        00:00:00 sudo python /home/pi/Desktop/PiControl/motion_sensor.py
  root     31874 31873 47 14:09 ?        00:14:30 python /home/pi/Desktop/PiControl/motion_sensor.py
  pi       32645 32202  0 14:39 pts/0    00:00:00 grep --color=auto motion_sensor.py
  </code></pre>