'ps' behavoir in Linux - Was - Re: array limits

Bill Vermillion fp at wjv.com
Fri Apr 16 23:09:11 PDT 2004


On Fri, Apr 16, 2004 at 09:34:28PM -0500, Jerry Rains thus spoke:

> On Friday 16 April 2004 02:15, Fairlight wrote:
>
> > Brian K. White cast forth these immortal, mystical words:

> > > on linux and freebsd to get full argment list I use ps
> > > auxwww you can add more w's to get more stuff to the right.
> > > after the command and it's arguments it will list some of
> > > the environment, up to all of it if you give enough w's

> > > try ps auxwwwwwwwwwwwwwwww |less -S

> > After the second w, the rest are redundant. I haven't used
> > more than that in years, and in linux's proc-ps, I don't
> > think more than two ever had more meaning. I think they may
> > have done in BSD 4.3,but that was a longggggg time ago.

> > 'ps auxww' is all you need.

> This doesn't work either. I included 'uname -a', in case
> that will shed any light on this. The install is SuSE8.2
> Professional, which was last brought up to date about a month
> ago.

> jmrains at Coastal:~> ps auxw | grep dclerk
> filepro  29589  0.0  0.2  1460  744 pts/2    S    20:40   0:00 [dclerk]
> jmrains  29676  0.0  0.2  3528  560 pts/3    S    20:43   0:00 grep dclerk
> jmrains at Coastal:~> ps auxww | grep dclerk
> filepro  29589  0.0  0.2  1460  744 pts/2    S    20:40   0:00 [dclerk]
> jmrains  29680  0.0  0.2  3528  560 pts/3    S    20:43   0:00 grep dclerk
> jmrains at Coastal:~> ps auxwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww | grep dclerk
> filepro  29589  0.0  0.2  1460  744 pts/2    S    20:40   0:00 [dclerk]
> jmrains  29684  0.0  0.2  3528  560 pts/3    S    20:43   0:00 grep dclerk
> jmrains at Coastal:~> uname -a
> Linux Coastal 2.4.20-4GB #1 Mon Mar 17 17:54:44 UTC 2003 i686 unknown unknown 
> GNU/Linux

I wonder if the version on SuSE may be different than what many
expect.

In some *n*x variants "l" [Ell] has to be used on the command line
to list the 'command' given with it's arguments.

You might try it.  Depending on what you are running at the time be
prepared for some extremely long lines so you will have to use
the ww option, as w will truncate at 132 columns.

Here is an example on this system currently running and compiling
an application and showing all the arguments to the command.


    0 12581 11786  69  10  0   632  408 wait   S+    p4    0:00.00 /bin/sh -ec (cd /usr/ports/print/ghostscript-afpl-nox11/work/ghostscript-8.14; /usr/bin/env CC="cc" CXX="c++" CFLAGS_STANDARD="-O -pipe "  XCFLAGS="-DUPD_SIGNAL=0 -DSTDINT_TYPES_DEFINED=1" SHELL=/bin/sh PORTOBJFORMAT=elf PREFIX=/usr/local LOCALBASE=/usr/local X11BASE=/usr/X11R6 MOTIFLIB="-L/usr/X11R6/lib -lXm -lXp" LIBDIR="/usr/lib" CFLAGS="-O -pipe " CXXFLAGS=" -O -pipe " MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install -c -s -o root -g wheel -m 555"  BSD_INSTALL_SCRIPT="install -c -o root -g wheel -m 555"  BSD_INSTALL_DATA="install -c -o root -g wheel -m 444"  BSD_INSTALL_MAN="install -c -o root -g wheel -m 444" gmake -f Makefile  all)

An interesting side effect of when I was capturing that output to
test the flags was that I also got an empty buffer from something
I did and one line of the file was 227641 characters long. I
remember the days when vi would fall over and truncate things
over about 256 bytes.

Give the 'l' option a shot, as it appears it's one you have not
used in your tests.  See the man page for ps and look for the flag
that displays the command line.  It may have been changed.  On this
system 'l' has a set of defaults incluing 'command', while 
other options that will display the command related to 
flags  c, f, j, u and v.

Bill
-- 
Bill Vermillion - bv @ wjv . com


More information about the Filepro-list mailing list