1833748 Members
2572 Online
110063 Solutions
New Discussion

Re: The usage of "ps"

 
SOLVED
Go to solution
peterchu
Super Advisor

The usage of "ps"

I have a user , the login ID is "acc_usr" , the user is running a very large process in my system ,

#who -u acc_usr
acc_usr pts/19 Mar 11 10:30 00:12 4231 (192.168.0.1)

but if I ps the user PID , the process is in "S" mode,
#ps -aux |grep 4231

root 4 231 0.0 0.0 2352 992 ? S 10:30 0:00 login -- acc_usr
acc_usr 319 0.0 0.0 3588 632 pts/22 S 11:51 0:00 grep 4231


I check with the command "top" , the user is running process , and in "R" mode , could suggest why ps can't find the "R" mode process , do I need to use other parameter ? thx.
3 REPLIES 3
Peter Godron
Honored Contributor
Solution

Re: The usage of "ps"

Hi,
what system are you running?
According to my man pages (HPUX 11.0) the command ps -aux should not work:
as
1. If any of the -a, -A, -d, or -e options is specified, the -C, -g, -G,-p, -R, -t, -u, and -U options are ignored.
2. -u uidlist Select processes whose effective user ID numbers or login names are given in uidlist.

All of this aside:
The default heading for the state column is S. Are you sure you are not looking at the default heading?
Regards
Keith Bryson
Honored Contributor

Re: The usage of "ps"

Hi Peterchu

I'm not sure what the -x switch on ps is for? Is this HP-UX? Anyway, try ps -eux rather than ps -aux. The -a option excludes certain processes. Maybe the 'R' process showing in top doesn't fit the criteria for the -a option.

Let us know how you get on - Keith
Arse-cover at all costs
Jdamian
Respected Contributor

Re: The usage of "ps"

What do you mean 'in "R" mode' ?
I cannot see a MODE column shown by "top" command. Instead, a "STATE" command is shown, where "run" or "sleep" states are displayed (not R).

I suspect your server is Solaris, not HP-UX, because

1st: the options of your 'ps' command (-aux) always report an error unless a user called 'x' is defined into /etc/passwd.

2nd: the output shown of your ps command is different from output of the ps command. Your output matches the output from /usr/ucb/ps in Solaris.

May you post the output of 'uname -a' ?