PS — User Commands
NAME
ps − print process status information
SYNOPSIS
ps [option(s)] [pid pid ...]
OPTIONS
−aPrint out information for processes belonging to all users (normally only the invoking user’s processes are printed).
−APrint out information for absolutely all processes, even dead ones.
−dPrint information only for processes in DEBUG state.
−helpPrint out a help message and exit without doing anything else.
−iInstead of the default status information, print information about various process ids (includes the PID, PPID, GROUP, USER, RUSER, TIME, and COMMAND fields).
−kPrint out information for kernel server processes in addition to any other processes requested with other switches.
−lUse local information for migrated processes rather than following them to their current hosts.
−mPrint information only for processes that are migrated to or from another machine.
−MInstead of the default status information, print information about process migration (includes the PID, STATE, FLAGS, EVENT, RNODE, RPID, and COMMAND fields).
−sInstead of the default status information, print information about signals (includes the PID, PENDING, HELD, IGNORE, HANDLE, and COMMAND fields).
−uInstead of the default status information, print additional “user-oriented” information, including PID, %CPU, %MEM, SIZE, RSS, STATE, TIME, PRI, and COMMAND.
−vInstead of the default status information, print virtual memory information (includes the PID, CODSZ, CODRS, HPSZ, HPRS, STKSZ, STKRS, SIZE, RSS, and COMMAND fields).
−w lineWidthUse lineWidth as the output line length, and format output so that it fits neatly on lines of this length. The COMMAND field gets truncated as necessary to accomplish this.
DESCRIPTION
This command prints out process status information. If one or more pid’s is given, then information is printed for those processes. If no pid is given, then information is printed for all processes belonging to the invoking user (additional processes may be requested with switches like −a).
By default, ps prints a short status report for each process, containing the PID, STATE, TIME, and COMMAND fields. Other forms of printout are available using switches like −u and −m.
FIELDS
The names of fields printed by ps (which appear at the tops of the columns of ps printout), and the meaning of the information printed in the fields, are:
CODRSThe amount of physical memory occupied by this process’s code segment, in units of 1024 bytes.
CODSZThe total size of this process’s code segment, in units of 1024 bytes. Not all of this is necessarily resident in memory.
COMMAND
The command that the process is executing. This field gets truncated if necessary to avoid running off the end of the line. Use the −w switch to request a longer line size when needed.
EVENTThe event field from the process control block (printed in hexadecimal). See the include file <kernel/proc.h> for further information.
FLAGSThe genFlags field from the process control block (printed in hexadecimal). See the include file <kernel/proc.h> for further information.
GROUPThe process group to which this process belongs.
HANDLEA hexadecimal value giving a bit-mask of the signals for which the process has specified handler procedures.
HELDA hexadecimal value giving a bit-mask of the signals currently “held” (prevented from being delivered to the process at its request).
HPRSThe amount of physical memory occupied by this process’s heap segment, in units of 1024 bytes.
HPSZThe total size of this process’s heap segment, in units of 1024 bytes.
IGNOREA hexadecimal value giving a bit-mask of the signals currently being ignored by the process
PIDThe process ID for the process.
PPIDThe process id of the parent of this process.
PRIThe priority of the process. Processes with normal priority have no specific priority listed. Server processes, with infinite priority, are listed as "S". Processes with above-normal priority are listed as ">", and processes with below-normal priority are listed as "<". Processes with VERY_LOW_PRIORITY are listed as "<<".
PENDINGA hexadecimal value giving a bit-mask of the signals that are awaiting delivery to the process.
RNODEFor a migrated process, this identifies the “other” node that the process belongs to (its home node if this is the remote node, or vice versa).
RPIDFor a migrated process, this contains the id of the process on its “other” node (its home node if this is the remote node, or vice versa).
RSSResident set size: the total physical memory occupied by this process, in units of 1024 bytes. This is the sum of CODRS, HPRS, and STKRS.
RUSERThe name of the user corresponding to the real user ID of this process.
SIZEThe total amount of virtual memory allocated to this process, in units of 1024 bytes. Not all of this memory is necessary resident in physical memory, and some of it may not even have been accessed. SIZE is equal to the sum of CODSZ, HPSZ, and STKSZ.
STATEThe current execution state of the process.
STKRSThe amount of physical memory occupied by this process’s stack segment, in units of 1024 bytes.
STKSZThe total size of this process’s heap segment, in units of 1024 bytes.
TIMEThe total CPU time consumed by the process, in minutes and seconds. This time includes both kernel and user time.
USERThe user name corresponding to the effective user ID of this process.
%CPUA smoothed average of the fraction of a CPU that this process has consumed over the last several seconds.
%MEMThe fraction of total physical memory occupied by this process’s segments. Does not include memory that belongs to the process but is swapped out.
KEYWORDS
process, status
Sprite version 1.0 — July 31, 1989