1832907 Members
3775 Online
110048 Solutions
New Discussion

ps help

 
SOLVED
Go to solution
Anthony khan
Frequent Advisor

ps help

Hi guys, I still have hangover thats why I dont like Monday but like Friday, anyway I am trying to run

ps -ef|grep ppserver

to get the pid and but I am getting 2 pids one for ppsever and second for grep, anyone give me a electric shock and weak me up how to do it.

6 REPLIES 6
Helen French
Honored Contributor

Re: ps help

Hi Anthony:

If i understood correctly, then this is normal. The pid which you are looking for is the one which is listed with the actual process (ppserver). The other one (grep) is the pid of your current process (ps). When you grep it, it will list all the process.

HTH,
Shiju
Life is a promise, fulfill it!
Jeff Schussele
Honored Contributor
Solution

Re: ps help

Hi Anthony,

Do
ps -ef | grep ppserver | grep -v grep
This will exclude the grep command.

HTH,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
MANOJ SRIVASTAVA
Honored Contributor

Re: ps help

Hi Anthony

It is definatley a hangover , grep checks for that string in the ps o/p so if the process is running then it will give you 2 o/ps one for the process and the other for the grep < process> name which is run by you and is also present in the process list.And if the process is not running then it will give you only one o/p for the grep . If you like you can again do grep -v to exclude the grep string that you have added in the process list.


Manoj Srivastava
H.Merijn Brand (procura
Honored Contributor

Re: ps help

Use the XPG4 mode:

l1:/u/usr/merijn 102 > ps -Cxfs
ps: illegal option -- C
ps: illegal option -- x
ps: illegal option -- s
usage: ps [-edaflP] [-u ulist] [-g glist] [-p plist] [-t tlist] [-R prmgroup]
Exit 1
l1:/u/usr/merijn 103 > env UNIX95=1 ps -Cxfs
PID TTY TIME CMD
16303 ? 00:00 xfs
l1:/u/usr/merijn 104 >

'man ps' will help you further with many nice features you get when you set UNIX95 to 1 :)
Enjoy, Have FUN! H.Merijn
pap
Respected Contributor

Re: ps help

Hi Anthony,
It looks good to me.
It is normal.
I think it will be better to take todays rest of the day off. Take a rest and then you will be normal....:)....
Just kidding...

whenver you give the ps -ef | grep command, it will always return PID of grep process which has been executed. your correct PID for the process is ppserver in the last column (from results of grep out put)

-pap


"Winners don't do different things , they do things differently"
Anthony khan
Frequent Advisor

Re: ps help

Thanks guys, I am getting better now, We had 2 warmest days in April and today we have snow I guess the weather is playing with us too.