[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: libps



> > One can get the gid via ps -G gid under Linux, DEC and Solaris:
> 
> There is no -G on my Linux syste.  

I am running Debian potato:
neal@school:~$ ps --version
neal@school:~$ uname -a
Linux school 2.2.14pre17 #1 SMP Tue Jan 4 21:41:13 EST 2000 i686 unknown
neal@school:~$ id
uid=1000(neal) gid=1000(walfield) groups=1000(walfield)
neal@school:~$ ps -G 1000
  PID TTY          TIME CMD
  257 tty2     00:00:00 bash
 1601 tty2     00:00:00 startx
 1602 tty2     00:00:00 xinit
 1603 ?        00:13:11 X
 1605 tty2     00:00:00 sh
 1606 tty2     00:04:56 enlightenment
 1616 ?        00:00:10 Eterm
 1619 pts/0    00:00:00 bash
 1624 ?        00:00:08 Eterm
 ...

 And the man page:
        --Group
	       select by real group name or ID

> That is about selecting processes based on GID, which is different from
> showing the GIDs of processes.  (Though the Hurd ps has neither.)


I see your point and under dec, one can do:
nwalfiel@jupiter:~$ ps -o pid,group,user,comm -A
 18003 cs2001   jhawkins bash
   872 cs2001   amerrifi pine
  1964 cs2001   amerrifi csh
 11308 staff    vogunro  pico
 14174 staff    vogunro  csh
...

Same idea under linux, I didn't bother to check Solaris.

-Neal

-- 
----------------------------------------------------------------------------
Neal Walfield                                              neal@walfield.org
UMass Lowell - Fox 1512                                  Phone: 978-934-5347
                                                           Fax: 603-415-3645
Love is the triumph of imagination over intelligence.
                -- H. L. Mencken


Reply to: