On Wed, 20 Aug 2003 10:30:37 -0500, The Wandering Dru 
<dru at druswanderings.net> wrote:

> Sam MacDonald wrote:
>
>> No I don't have a fire wall running (thank you James Spinti)
>>
>> I did (as root) ps -ef grep | sshd   (thank you Johnny Fulcrum)
>> results
>
> The pipe "|" goes _before_ the grep command.  What this does is send the 
> output of the ps command to grep to use as input.  Aahhhh, the beauty of 
> *nix.
>
> If you get no output from "ps -ef | grep sshd", then the sshd server is 
> not running or perhaps not installed.


I should have said do a

ps -ef |grep -v grep|grep sshd

from the command line...

in the original command I posted, the ps -ef lists out all the processes 
running - then grep or look through that output for the shhd command (if it 
shows up, then it's running)....

BUT

since we are running a command that has "sshd" as an "argument" it also 
shows up on the ps -ef out put!!!!  (you saw this as root   27813 27782   
0:09:04  tty1  00:00:00:  grep sshd)

Soooo....

we do a pipe to grep -v grep THEN a pipe to grep for sshd

the grep -v grep says to list everything but stuff that has "grep" in it... 
 so we won't see out grep sshd as one of the commands running....

Aaaahhhhh the beauty of *nix indeed!

Having fun yet?!?!


_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list