Binand Sethumadhavan <[EMAIL PROTECTED]> wrote:
> On Thu, 23 Dec 2004 15:05:34 +0530, Shridhar Daithankar
> <[EMAIL PROTECTED]> wrote:
> > With head you eliminate the last grep, which is your grep(most probably)
> > because they are ordered by pid..:-)
> 
> Hmm... what if the PID rolled over and started again from 1?
> 

We can use the "-o" option of ps command to get the 
elapsed time too. The earlier grep cmd should/would 
have a greater elapsed time.

eg.
$ grep grep &
$ ps ax -o etime,cmd | grep grep
      00:05 grep grep
      00:00 grep grep

Now use awk or whatever to sort on elapsed time, 
and kill that damn grep!

--
Rohan


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
linux-india-help mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-india-help

Reply via email to