


PS(1)		Linux Programmer's Manual		PS(1)


NNAAMMEE
       ps - report process status

SSYYNNOOPPSSIISS
       ps [-][lujsvmaxScewhrnu][txx]

DDEESSCCRRIIPPTTIIOONN
       ppss gives a snapshot of the current processes.  If you want
       a repetitive update of this status,  use	ttoopp..	This  man
       page documents the /proc-based version of ps, or tries to.


CCOOMMMMAANNDD--LLIINNEE OOPPTTIIOONNSS
       Command line arguments may optionally be	preceeded  by	a
       '-',  but  there	is no need for it.  Please note that not
       all these options may  work,  but  most	should.	If  you
       depend  on  one	that  isn't  there,  please contact john-
       sonm@stolaf.edu about it, explaining what you need.  If it
       can be added, I will, and if it can't you will want to use
       the kmem-based ps.

       ll    long format

       uu    user format: gives user name and start time

       jj    jobs format: pgid sid

       ss    signal format

       vv    vm format

       mm    displays memory info (combine with p flag to get num-
	    ber of pages).

       aa    show processes of other users too

       xx    show processes without controlling terminal

       SS    add child cpu time and page faults

       cc    command name from task_struct

       ee    show environment

       ww    wide  output:  don't truncate command lines to fit on
	    one line.

       hh    no header

       rr    running procs only

       nn    numeric output for USER and WCHAN.

       ttxxxx  only procs with controlling tty xx, use  for  xx  the



Cohesive Systems	   14 Jan 1993				1





PS(1)		Linux Programmer's Manual		PS(1)


	    same  letters  as shown in TT field.  tty name or pid
	    must be given after the last option,  with	no  space
	    between options and pid or tty.


FFIIEELLDD DDEESSCCRRIIPPTTIIOONNSS
       PPRRII  This  is the counter field in the task struct.  It is
	    the time in HZ of the process's possible timeslice.

       NNII   Standard unix nice value, a positive value means less
	    cpu time.

       SSIIZZEE virtual image size, size of text+data+stack

       RRSSSS  resident set size, kilobytes of program in memory.

       WWCCHHAANN
	    name  of  the  kernel  function  where the process is
	    sleeping.  This does not work, because namelist func-
	    tionality has not been added to ps yet.

       SSTTAATT

	RR runnable

	SS sleeping

	DD uninterruptible sleep

	TT stopped or traced

	ZZ zombie

	WW process has no resident pages

       TTTT   controlling tty

       PPAAGGEEIINN
	    number  of	major  page  faults, that is, page faults
	    that cause pages to be read from disk.

       TTRRSS  text resident size

       SSWWAAPP kilobytes (with -p pages) on swap device

       SSHHAARREE
	    shared memory

UUPPDDAATTIINNGG
       ppss This proc-based ps works by reading the  files  in  the
       proc  filesystem, mounted on /proc.  This ps does not need
       to be suid kmem or anything else to run.	DDoo nnoott ggiivvee tthhiiss
       ppss aannyy ssppeecciiaall ppeerrmmiissssiioonnss..




Cohesive Systems	   14 Jan 1993				2





PS(1)		Linux Programmer's Manual		PS(1)


       You  will  need to update the /etc/psdatabase file by run-
       ning a special suid program called  /etc/psupdate  to  get
       meaningful information from the WCHAN field.


NNOOTTEESS
       The  member 'used_math' of task_struct is not shown, since
       crt0.s checks to see if math is present.	This causes  the
       math flag to be set for all processes, and so it is worth-
       less.

       Programs swapped out to disk will be shown without command
       line  arguments,	and  unless  the "c" option is given, in
       parentheses.

       WCHAN (l format) shows the function in which  the  process
       is  sleeping,  with the 'sys_' part is stripped from func-
       tion names.  If /etc/psdatabase does not exist, it is just
       a hex number instead.

       %CPU (u format) shows the cputime/realtime percentage.

       PAGEIN  (v  format):  pages read from the buffer cache are
       counted as major page faults.

       The SIZE and RSS fields don't count the	page  tables  and
       the  task_struct of a proc, this is at least 12k of memory
       that is always resident. SIZE is the virtual size  of  the
       proc (code+data+stack).

       %CPU  will not add up to 100% unless you are lucky.  It is
       time used divided by the time the process  has  been  run-
       ning.

BBUUGGSS
       Tty names are hard coded: virtual consoles are a1, a2, ...
       serial lines are A0 and A1, pty's are p0, p1 ...

AAUUTTHHOORR
       ppss   was	originally   written	by   Branko	Lankester
       (lankeste@fwi.uva.nl)	Michael	K.	Johnson   (john-
       sonm@stolaf.edu) re-wrote it significantly to use the proc
       filesystem, changing a few things in the process.














Cohesive Systems	   14 Jan 1993				3


