I want to run command "/usr/ucb/ps auxww" on solaris to extract SZ and RSS values. For some processes these values are not showing and mixing with %MEM value as shown below.

root         3  0.1  0.0    0    0 ?        S   Feb 08 3395:09 fsflush
root      6589  0.1  0.15985621000 ?        S   Feb 08 1309:24 ./ssmagent.bin -
root      7232  0.0  0.0 3912 3344 pts/7    O 12:55:34  0:00 /usr/ucb/ps -auxww

If you see here, for PID 6589 there is no seperate SZ and RSS values, I am not sure these are mixed in %MEM.

Is there anyway I can mention fixed width for each column?


This is a quirk of the UCB ps command, which, back when 80-column terminals were sufficient, was never expected to need more than 5 chars for the size and RSS columns.

The standard (POSIX) ps output also looks rough when the SZ and RSS columns contain large numbers, but then it at least keeps a space between the columns.

With the POSIX ps command, you can use the -o option to specify which columns appear in the output, and you can also specify the column headings.

So you could use:

ps -o user,pid,pcpu,pmem,osz,rss,stime,time,args

to get similar output, and then use:

ps -o user,pid,pcpu,pmem,osz='---Size---' -o rss='---RSS---' -o stime,time,args

...to make the SZ and RSS columns wider.

But I think the POSIX ps command still truncates the args column, unlike the ww option of /usr/ucb/ps

| improve this answer | |

Is ps -el available on those platforms? It produces fields of fixed lengths on Mac OS X and on Linux(Debian testing).

| improve this answer | |
  • Please see above for my edited question,this has more detailed information that I am looking for. – goutham Jul 6 '10 at 18:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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