The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM



View Single Post in UNIX Forums - Click on the Thread or Permalink to View Entire Thread -->
  #3 (permalink)  
Old 06-11-2007
aigles's Avatar
aigles aigles is offline
Registered User
 

Join Date: Apr 2004
Location: Bordeaux, France
Posts: 1,212
Quote:
Originally Posted by lorcan
This is to find the pid for the single process

Code:
ps -ef | grep 'your procees' | grep -v grep | awk '{print $2}' | read pid
You can do yhe work without using the grep command :
Code:
pid=`ps -ef | awk '/your process/{ print $2 }'`
Jean-Pierre.
Reply With Quote