Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I've a different behaviour for the same command on 2 different machines:

Server 1:

sudo /bin/ps -AF | grep sudo

root 19370 14291 0 1809 828 3 11:12 pts/1 00:00:00 grep sudo 

Server 2:

sudo ps -AF | grep sudo

root 17706 12645 0 5604 1228 2 11:13 pts/0 00:00:00 sudo ps -AF 
root 17707 12645 0 2402 896 1 11:13 pts/0 00:00:00 grep sudo

Sever 2 displays the sudo process, Server 1 not. How can that be?

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Depending on the ps version and which distro you are using, ps command may doesn't show itself in the listing.

CentOS, procps version 3.2.7:

$ sudo /bin/ps -AF | grep sudo
quanta   19175 14068  0 15302   740   7 17:04 pts/1    00:00:00 grep sudo

Gentoo, procps version 3.2.8:

$ sudo /bin/ps -AF | grep sudo
root      4842  4783  0  1512  1468   0 16:54 pts/10   00:00:00 sudo /bin/ps -AF
quanta    4843  4783  0  1059   844   1 16:54 pts/10   00:00:00 grep --colour=auto sudo
share|improve this answer
    
ok, my servers differ in the debian version. Server 1 runs lenny and Server 2 squeeze. Do you know if there is a difference? Is there a parameter to change the behaviour? –  markus Oct 25 '11 at 11:32
    
Run ps -V to check the version. What is your final goal? AFAIK, there is no option to change this behaviour. But you can download the procps source code to compile. –  quanta Oct 25 '11 at 12:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.