Dennis Davis wrote:
From: Nick Holland <[EMAIL PROTECTED]>
(note: grepping the output of "ps -ax" is a starting point...but
remember: sometimes the you will pick up the grep line itself in ps...)
[...]
so instead write:

bahamontes $ ps -ax|grep '[n]tpd'
23336 ??  Is      0:00.11 ntpd: [priv] (ntpd)
10490 ??  I       0:10.36 ntpd: ntp engine (ntpd)

or use "pgrep", that's what it's for.

$ ps -ax | grep '[n]tp'
16051 ??  Is      0:01.18 ntpd: [priv] (ntpd)
32439 00- I       0:27.43 ntpd: ntp engine (ntpd)
$ pgrep -u _ntp ntpd
32439
$ pgrep -u root ntpd
16051

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
    Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.

Reply via email to