1.\" Copyright (c) 1980, 1990, 1991 The Regents of the University of California. 2.\" All rights reserved. 3.\" 4.\" %sccs.include.redist.roff% 5.\" 6.\" @(#)ps.1 6.18 (Berkeley) 07/06/92 7.\" 8.Dd 9.Dt PS 1 10.Os BSD 4 11.Sh NAME 12.Nm \&ps 13.Nd process status 14.Sh SYNOPSIS 15.Nm \&ps 16.Op Fl aChjlmrSTuvwx 17.Op Fl M Ar core 18.Op Fl N Ar system 19.Op Fl O Ar fmt 20.Op Fl o Ar fmt 21.Op Fl p Ar pid 22.Op Fl t Ar tty 23.Op Fl W Ar swap 24.Nm ps 25.Op Fl L 26.Sh DESCRIPTION 27.Nm \&Ps 28displays a header line followed by lines containing information about your 29processes that have controlling terminals. 30This information is sorted by process 31.Tn ID . 32.Pp 33The information displayed is selected based on a set of keywords (see the 34.Fl L 35.Fl O 36and 37.Fl o 38options). 39The default output format includes, for each process, the process' 40.Tn ID , 41controlling terminal, cpu time (including both user and system time), 42state, and associated command. 43.Pp 44The options are as follows: 45.Bl -tag -width indent 46.It Fl a 47Display information about other users' processes as well as your own. 48.It Fl C 49Change the way the cpu percentage is calculated by using a ``raw'' 50cpu calculation that ignores ``resident'' time (this normally has 51no effect). 52.It Fl h 53Repeat the information header as often as necessary to guarantee one 54header per page of information. 55.It Fl j 56Print information associated with the following keywords: 57user, pid, ppid, pgid, sess, jobc, state, tt, time and command. 58.It Fl L 59List the set of available keywords. 60.It Fl l 61Display information associated with the following keywords: 62uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time 63and command. 64.It Fl M 65Extract values associated with the name list from the specified core 66instead of the default 67.Dq Pa /dev/kmem . 68.It Fl m 69Sort by memory usage, instead of by process 70.Tn ID . 71.It Fl N 72Extract the name list from the specified system instead of the default 73.Dq Pa /vmunix . 74.It Fl O 75Add the information associated with the space or comma separated list 76of keywords specifed, after the process 77.Tn ID , 78in the default information 79display. 80Keywords may be appended with an equals (``='') sign and a string. 81This causes the printed header to use the specified string instead of 82the standard header. 83.It Fl o 84Display information associated with the space or comma separated list 85of keywords specifed. 86Keywords may be appended with an equals (``='') sign and a string. 87This causes the printed header to use the specified string instead of 88the standard header. 89.It Fl p 90Display information associated with the specified process 91.Tn ID . 92.It Fl r 93Sort by current cpu usage, instead of by process 94.Tn ID . 95.It Fl S 96Change the way the process time is calculated by summing all exited 97children to their parent process. 98.It Fl T 99Display information about processes attached to the device associated 100with the standard input. 101.It Fl t 102Display information about processes attached to the specified terminal 103device. 104.It Fl u 105Display information associated with the following keywords: 106user, pid, %cpu, %mem, vsz, rss, tt, state, start, time and command. 107The 108.Fl u 109option implies the 110.Fl r 111option. 112.It Fl v 113Display information associated with the following keywords: 114pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, trss, 115%cpu, %mem and command. 116The 117.Fl v 118option implies the 119.Fl m 120option. 121.It Fl W 122Extract swap information from the specified file instead of the 123default 124.Dq Pa /dev/swap . 125.It Fl w 126Use 132 columns to display information, instead of the default which 127is your window size. 128If the 129.Fl w 130option is specified more than once, 131.Nm \&ps 132will use as many columns as necessary without regard for your window size. 133.It Fl x 134Display information about processes without controlling terminals. 135.El 136.Pp 137A complete list of the available keywords are listed below. 138Some of these keywords are further specifed as follows: 139.Bl -tag -width indent 140.It %cpu 141The cpu utilization of the process; this is a decaying average over up to 142a minute of previous (real) time. 143Since the time base over which this is computed varies (since processes may 144be very young) it is possible for the sum of all 145.Tn \&%CPU 146fields to exceed 100%. 147.It %mem 148The percentage of real memory used by this process. 149.It flags 150The flags (in hexadecimal) associated with the process as in 151the include file 152.Aq Pa sys/proc.h : 153.Bl -column SNOCLDSTOP SNOCLDSTOP 154.It Dv "SLOAD" Ta No "0x0000001 in core" 155.It Dv "SSYS" Ta No "0x0000002 swapper or pager process" 156.It Dv "SLOCK" Ta No "0x0000004 process being swapped out" 157.It Dv "SSWAP" Ta No "0x0000008 save area flag" 158.It Dv "STRC" Ta No "0x0000010 process is being traced" 159.It Dv "SWTED" Ta No "0x0000020 another tracing flag" 160.It Dv "SSINTR" Ta No "0x0000040 sleep is interruptible" 161.It Dv "SKEEP" Ta No "0x0000100 another flag to prevent swap out" 162.It Dv "SOMASK" Ta No "0x0000200 restore old mask after taking signal" 163.It Dv "SWEXIT" Ta No "0x0000400 working on exiting" 164.It Dv "SPHYSIO" Ta No "0x0000800 doing physical" 165.Tn I/O 166.It Dv "SVFORK" Ta No "0x0001000 process resulted from" 167.Xr vfork 2 168.It Dv "SVFDONE" Ta No "0x0002000 another" 169.Xr vfork 170flag 171.It Dv "SNOVM" Ta No "0x0004000 no vm, parent in a" 172.Xr vfork 173.It Dv "SPAGV" Ta No "0x0008000 init data space on demand, from vnode" 174.It Dv "SSEQL" Ta No "0x0010000 user warned of sequential vm behavior" 175.It Dv "SUANOM" Ta No "0x0020000 user warned of random vm behavior" 176.It Dv "STIMO" Ta No "0x0040000 timing out during sleep" 177.It Dv "SNOCLDSTOP" Ta No "0x0080000 no" 178.Dv SIGCHLD 179when children stop 180.It Dv "SCTTY" Ta No "0x0100000 has a controlling terminal" 181.It Dv "SOWEUPC" Ta No "0x0200000 owe process an addupc() call at next ast" 182.\" the routine addupc is not documented in the man pages 183.It Dv "SSEL" Ta No "0x0400000 selecting; wakeup/waiting danger" 184.It Dv "SEXEC" Ta No "0x0800000 process called" 185.Xr exec 2 186.It Dv "SHPUX" Ta No "0x1000000 \\*(tNHP-UX\\*(sP process 187.Pq Dv HPUXCOMPAT 188.It Dv "SULOCK" Ta No "0x2000000 locked in core after swap error" 189.It Dv "SPTECHG" Ta No "0x4000000 pte's for process have changed" 190.El 191.It lim 192The soft limit on memory used, specified via a call to 193.Xr setrlimit 2 . 194.It lstart 195The exact time the command started, using the ``%C'' format described in 196.Xr strftime 3 . 197.It nice 198The process scheduling increment (see 199.Xr setpriority 2 ) . 200.It rss 201the real memory (resident set) size of the process (in 1024 byte units). 202.It start 203The time the command started. 204If the command started less than 24 hours ago, the start time is 205displayed using the ``%l:ps.1p'' format described in 206.Xr strftime 3 . 207If the command started less than 7 days ago, the start time is 208displayed using the ``%a6.15p'' format. 209Otherwise, the start time is displayed using the ``%e%b%y'' format. 210.It state 211The state is given by a sequence of letters, for example, 212.Dq Tn RWNA . 213The first letter indicates the run state of the process: 214.Pp 215.Bl -tag -width indent -compact 216.It D 217Marks a process in disk (or other short term, uninterruptable) wait. 218.It I 219Marks a process that is idle (sleeping for longer than about 20 seconds). 220.It R 221Marks a runnable process. 222.It S 223Marks a process that is sleeping for less than about 20 seconds. 224.It T 225Marks a stopped process. 226.It Z 227Marks a dead process (a ``zombie''). 228.El 229.Pp 230Additional characters after these, if any, indicate additional state 231information: 232.Pp 233.Bl -tag -width indent -compact 234.It + 235The process is in the foreground process group of its control terminal. 236.It < 237The process has raised 238.Tn CPU 239scheduling priority. 240.It > 241The process has specified a soft limit on memory requirements and is 242currently exceeding that limit; such a process is (necessarily) not 243swapped. 244.It A 245the process has asked for random page replacement 246.Pf ( Dv VA_ANOM , 247from 248.Xr vadvise 2 , 249for example, 250.Xr lisp 1 251in a garbage collect). 252.It E 253The process is trying to exit. 254.It L 255The process has pages locked in core (for example, for raw 256.Tn I/O ) . 257.It N 258The process has reduced 259.Tn CPU 260scheduling priority (see 261.Xr setpriority 2 ) . 262.It S 263The process has asked for 264.Tn FIFO 265page replacement 266.Pf ( Dv VA_SEQL , 267from 268.Xr vadvise 2 , 269for example, a large image processing program using virtual memory to 270sequentially address voluminous data). 271.It s 272The process is a session leader. 273.It V 274The process is suspended during a 275.Xr vfork . 276.It W 277The process is swapped out. 278.It X 279The process is being traced or debugged. 280.El 281.It tt 282An abbreviation for the pathname of the controlling terminal, if any. 283The abbreviation consists of the two letters following 284.Dq Pa /dev/tty , 285or, for the console, ``co''. 286This is followed by a ``-'' if the process can no longer reach that 287controlling terminal (i.e., it has been revoked). 288.It wchan 289The event (an address in the system) on which a process waits. 290When printed numerically, the initial part of the address is 291trimmed off and the result is printed in hex, for example, 0x80324000 prints 292as 324000. 293.El 294.Pp 295When printing using the command keyword, a process that has exited and 296has a parent that has not yet waited for the process (in other words, a zombie) 297is listed as ``<defunct>'', and a process which is blocked while trying 298to exit is listed as ``<exiting>''. 299.Nm \&Ps 300makes an educated guess as to the file name and arguments given when the 301process was created by examining memory or the swap area. 302The method is inherently somewhat unreliable and in any event a process 303is entitled to destroy this information, so the names cannot be depended 304on too much. 305The ucomm (accounting) keyword can, however, be depended on. 306.Sh KEYWORDS 307The following is a complete list of the available keywords and their 308meanings. 309Several of them have aliases (keywords which are synonyms). 310.Pp 311.Bl -tag -width sigignore -compact 312.It %cpu 313percentage cpu usage (alias pcpu) 314.It %mem 315percentage memory usage (alias pmem) 316.It acflag 317accounting flag (alias acflg) 318.It command 319command and arguments 320.It cpu 321short-term cpu usage factor (for scheduling) 322.It flags 323the process flags, in hexadecimal (alias f) 324.It inblk 325total blocks read (alias inblock) 326.It jobc 327job control count 328.It ktrace 329tracing flags 330.It ktracep 331tracing vnode 332.It lim 333memoryuse limit 334.It logname 335login name of user who started the process 336.It lstart 337time started 338.It majflt 339total page faults 340.It minflt 341total page reclaims 342.It msgrcv 343total messages received (reads from pipes/sockets) 344.It msgsnd 345total messages sent (writes on pipes/sockets) 346.It nice 347nice value (alias ni) 348.It nivcsw 349total involuntary context switches 350.It nsigs 351total signals taken (alias nsignals) 352.It nswap 353total swaps in/out 354.It nvcsw 355total voluntary context switches 356.It nwchan 357wait channel (as an address) 358.It oublk 359total blocks written (alias oublock) 360.It p_ru 361resource usage (valid only for zombie) 362.It paddr 363swap address 364.It pagein 365pageins (same as majflt) 366.It pgid 367process group number 368.It pid 369process 370.Tn ID 371.It poip 372pageouts in progress 373.It ppid 374parent process 375.Tn ID 376.It pri 377scheduling priority 378.It re 379core residency time (in seconds; 127 = infinity) 380.It rgid 381real group 382.Tn ID 383.It rlink 384reverse link on run queue, or 0 385.It rss 386resident set size 387.It rsz 388resident set size + (text size / text use count) (alias rssize) 389.It ruid 390real user 391.Tn ID 392.It ruser 393user name (from ruid) 394.It sess 395session pointer 396.It sig 397pending signals (alias pending) 398.It sigcatch 399caught signals (alias caught) 400.It sigignore 401ignored signals (alias ignored) 402.It sigmask 403blocked signals (alias blocked) 404.It sl 405sleep time (in seconds; 127 = infinity) 406.It start 407time started 408.It state 409symbolic process state (alias stat) 410.It svgid 411saved gid from a setgid executable 412.It svuid 413saved uid from a setuid executable 414.It tdev 415control terminal device number 416.It time 417accumulated cpu time, user + system (alias cputime) 418.It tpgid 419control terminal process group 420.Tn ID 421.It trss 422text resident set size (in Kbytes) 423.It tsess 424control terminal session pointer 425.It tsiz 426text size (in Kbytes) 427.It tt 428control terminal name (two letter abbreviation) 429.It tty 430full name of control terminal 431.It uprocp 432process pointer 433.It ucomm 434name to be used for accounting 435.It uid 436effective user 437.Tn ID 438.It upr 439scheduling priority on return from system call (alias usrpri) 440.It user 441user name (from uid) 442.It vsz 443virtual size in Kbytes (alias vsize) 444.It wchan 445wait channel (as a symbolic name) 446.It xstat 447exit or stop status (valid only for stopped or zombie process) 448.El 449.Sh FILES 450.Bl -tag -width /var/run/kvm_vmunix.db -compact 451.It Pa /dev 452special files and device names 453.It Pa /dev/drum 454default swap device 455.It Pa /dev/kmem 456default kernel memory 457.It Pa /var/run/dev.db 458/dev name database 459.It Pa /var/run/kvm_vmunix.db 460system namelist database 461.It Pa /vmunix 462default system namelist 463.El 464.Sh SEE ALSO 465.Xr kill 1 , 466.Xr w 1 , 467.Xr kvm 3 , 468.Xr strftime 3 , 469.Xr pstat 8 470.Sh BUGS 471Since 472.Nm \&ps 473cannot run faster than the system and is run as any other scheduled 474process, the information it displays can never be exact. 475