[wplug] ps without the threads

Brian S. Woolstrum woolstrum at cmu.edu
Thu Dec 12 19:11:38 EST 2002


I'm not really sure about it but I'm thinking the first
'main' process should be what ps refers to as the 'session
leader'  If that is the case you could try "ps -Nd" where
the "N" is for "negate selection" and the "d" is "select
all, but omit selection leaders"

If you are having to do a lot of processing on the output
of ps, is it possible the the "-o" "user-defined format"
might cut down on some of that?  For example,
"ps -Ndo pid,fname" gives me the following:

  PID COMMAND
   86 dhcpcd
   88 rpc.port
   96 syslogd
   99 klogd
  101 inetd
  105 sshd
  114 rpc.rquo
  126 rpc.moun
  129 rpc.stat
  131 lpd
  136 named
  140 atd
  148 sendmail
  152 apmd
  173 httpd
  200 agetty
  201 agetty
  202 agetty
  203 agetty
  204 agetty
  205 agetty
  206 kdm
  305 nmbd
 1242 in.ident
 5466 bash
 6698 bash
 6986 bash


although a "ps -axfo pid,fname" can give you a real clear
picture of which ones are the parent processes.


On Thu, 12 Dec 2002, Kevin Olalde wrote:

> Thanks.  We're already going the grep route.  The ps output goes though a
> number processes on the was to its final destination (loosing newline
> formatting along the way).
>
> Since we don't need the thread info, just the first 'main' process, I was
> just looking to avoid some downstream processing.
>
> I've got a couple of processes, with VERY large command lines, each
> creating 100+ threads.  I need the command line info, but not an extra 100
> times.
>
> Thanks,
> Kevin
>
> On Thu, 12 Dec 2002, Vanco, Donald wrote:
>
> > > -----Original Message-----
> > > From: Kevin Olalde [mailto:kevin at olalde.org]
> > > Sent: Thursday, December 12, 2002 2:53 PM
> > > To: wplug at wplug.org
> > > Subject: [wplug] ps without the threads
> > >
> > >
> > > Anyone know of a ps-like command that doesn't show all a
> > > processes threads?
> > >
> > > I'm using RH 7.2
> >
> > ps + grep?
> >
> > There's a few GUI tools.
> >
> > What are you trying to look for/at?
> >
> > Don
> > _______________________________________________
> > wplug mailing list
> > wplug at wplug.org
> > http://www.wplug.org/mailman/listinfo/wplug
> >
>
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug
>




More information about the wplug mailing list