man.bsd.lv manual page server

Manual Page Search Parameters

PS(1) General Commands Manual PS(1)

psprocess status

ps [-AaCcefHhjlmrRSTuvwx] [-M core] [-N system] [-O fmt] [-o fmt] [-p pid] [-t tty] [-U username]

ps [-L]

The ps utility displays a header line followed by lines containing information about your processes that have controlling terminals. This information is sorted by controlling terminal, then by process ID.

The information displayed is selected based on a set of keywords (see the -L -O and -o options). The default output format includes, for each process, the process' ID, controlling terminal, CPU time (including both user and system time), state, and associated command.

The process file system (see procfs(5)) should be mounted when ps is executed, otherwise not all information will be available.

The options are as follows:

Display information about other users' processes as well as your own. This can be disabled by setting the security.ps_showallprocs sysctl to zero.
Same as -ax.
Change the ``command'' column output to just contain the executable name, rather than the full command line.
Change the way the CPU percentage is calculated by using a ``raw'' CPU calculation that ignores ``resident'' time (this normally has no effect).
Display the environment as well.
Show commandline and environment information about swapped out processes. This option is honored only if the uid of the user is 0.
Print one line per lightweight process (LWP) instead of one line per process. When this option is set and the -o option is not set, the tid column is inserted in the output format after the pid one.
Repeat the information header as often as necessary to guarantee one header per page of information.
Print information associated with the following keywords: user, pid, ppid, pgid, sess, jobc, state, tt, time, and command.
List the set of available keywords.
Display information associated with the following keywords: uid, pid, ppid, cpu, pri, nice, vsz, rss, wchan, state, tt, time, and command.
Extract values associated with the name list from the specified core instead of the default /dev/kmem.
Sort by memory usage, instead of by process ID.
Extract the name list from the specified system instead of the default /boot/kernel.
Add the information associated with the space or comma separated list of keywords specified, after the process ID, in the default information display. Keywords may be appended with an equals (``='') sign and a string. This causes the printed header to use the specified string instead of the standard header.
Display information associated with the space or comma separated list of keywords specified. Keywords may be appended with an equals (``='') sign and a string. This causes the printed header to use the specified string instead of the standard header.
Display information associated with the specified process ID.
Sort by current CPU usage, instead of by process ID.
Subsort by parent/child chain. This very useful option makes the parent/child associations clear and understandable. If used in combination with -p then all children of the specified process will be output recursively in addition to the process itself.
Change the way the process time is calculated by summing all exited children to their parent process.
Display information about processes attached to the device associated with the standard input.
Display information about processes attached to the specified terminal device.
Display the processes belonging to the specified username.
Display information associated with the following keywords: user, pid, %cpu, %mem, vsz, rss, tt, state, start, time, and command. The -u option implies the -r option.
Display information associated with the following keywords: pid, state, time, sl, re, pagein, vsz, rss, lim, tsiz, %cpu, %mem and command. The -v option implies the -m option.
Use 132 columns to display information, instead of the default which is your window size. If the -w option is specified more than once, ps will use as many columns as necessary without regard for your window size.
Display information about processes without controlling terminals.

A complete list of the available keywords are listed below. Some of these keywords are further specified as follows:

The CPU utilization of the process; this is a decaying average over up to a minute of previous (real) time. Since the time base over which this is computed varies (since processes may be very young) it is possible for the sum of all %cpu fields to exceed 100%.
The percentage of real memory used by this process.
The flags associated with the process as in the include file <sys/proc.h>.
The soft limit on memory used, specified via a call to setrlimit(2).
The exact time the command started, using the ``%c'' format described in strftime(3).
The process scheduling increment (see setpriority(2)).
the real memory (resident set) size of the process (in 1024 byte units).
The time the command started. If the command started less than 24 hours ago, the start time is displayed using the ``%l:ps.1p'' format described in strftime(3). If the command started less than 7 days ago, the start time is displayed using the ``%a6.15p'' format. Otherwise, the start time is displayed using the ``%e%b%y'' format.
The state is given by a sequence of letters, for example, “RWNA”. The first letter indicates the run state of the process:

Marks a blocked kernel thread.
Marks a process in disk (or other short term, uninterruptible) wait.
Marks a process that is idle (sleeping for longer than about 20 seconds).
Marks a process which is in jail(2). The hostname of the prison can be found in /proc/pid/status.
Marks a runnable process and is followed by the CPU number.
Marks a process that is sleeping for less than about 20 seconds.
Marks a stopped process.
Marks a dead process (a “zombie”).

Additional characters after these, if any, indicate additional state information:

The process is in the foreground process group of its control terminal.
The process has raised CPU scheduling priority.
The process has specified a soft limit on memory requirements and is currently exceeding that limit; such a process is (necessarily) not swapped.
the process has asked for random page replacement (MADV_RANDOM, from madvise(2), for example, lisp(1) in a garbage collect).
The process is trying to exit.
The process has reduced CPU scheduling priority (see setpriority(2)).
The process has asked for FIFO page replacement (MADV_SEQUENTIAL, from madvise(2), for example, a large image processing program using virtual memory to sequentially address voluminous data).
The process is a session leader.
The process is suspended during a vfork(2).
The process is swapped out.
The process is being traced or debugged.
An abbreviation for the pathname of the controlling terminal, if any. The abbreviation consists of the three letters following /dev/tty, or, for the console, ``con''. This is followed by a ``-'' if the process can no longer reach that controlling terminal (i.e., it has been revoked).
The event (an address in the system) on which a process waits. When printed numerically, the initial part of the address is trimmed off and the result is printed in hex, for example, 0x80324000 prints as 324000. Note that blocked threads often only have ascii wchan's.

When printing using the command keyword, a process that has exited and has a parent that has not yet waited for the process (in other words, a zombie) is listed as ``<defunct>'', and a process which is blocked while trying to exit is listed as ``<exiting>''. The ps utility makes an educated guess as to the file name and arguments given when the process was created by examining memory or the swap area. The method is inherently somewhat unreliable and in any event a process is entitled to destroy this information, so the names cannot be depended on too much. The ucomm (accounting) keyword can, however, be depended on.

The following is a complete list of the available keywords and their meanings. Several of them have aliases (keywords which are synonyms).

percentage CPU usage (alias pcpu)
percentage memory usage (alias pmem)
accounting flag (alias acflg)
batchness of the process (higher numbers mean less interactivity)
command and arguments (alias args)
short-term CPU usage factor (for scheduling)
the process flags, in hexadecimal (alias flags)
total blocks read (alias inblock)
jail ID
job control count
tracing flags
CPU ID the process was last scheduled on
memoryuse limit
login name of user who started the process (alias logname)
time started
total page faults
total page reclaims
total messages received (reads from pipes/sockets)
total messages sent (writes on pipes/sockets)
nice value (alias ni)
total involuntary context switches
number of lightweight processes
total signals taken (alias nsignals)
total swaps in/out
total voluntary context switches
wait channel (as an address)
total blocks written (alias oublock)
resource usage (valid only for zombie)
swap address
pageins (same as majflt)
process group number
process ID
parent process ID
scheduling priority (lower == better)
core residency time (in seconds; 127 = infinity)
real group ID
resident set size
resident set size + (text size / text use count) (alias rssize)
realtime priority (101 = not a realtime process)
real user ID
user name (from ruid)
session pointer
pending signals (alias pending)
caught signals (alias caught)
ignored signals (alias ignored)
blocked signals (alias blocked)
sleep time (in seconds; 127 = infinity)
time started
symbolic process state (alias stat)
saved gid from a setgid executable
saved uid from a setuid executable
control terminal device number
LWKT thread priority (0-31, 31 highest), and critical section count
thread ID (aka lightweight process ID)
accumulated CPU time, user + system (alias cputime)
control terminal process group ID
control terminal session pointer
pending thread signals
text size (in Kbytes)
control terminal name (two letter abbreviation)
full name of control terminal
name to be used for accounting (alias comm)
effective user ID
user name (from uid)
virtual size in Kbytes (alias vsize)
wait channel (as a symbolic name)
exit or stop status (valid only for stopped or zombie process)

/dev/kmem
default kernel memory
/var/run/dev.db
/dev name database
/boot/kernel/kernel
default system namelist
/proc
the mount point of procfs(5)

kill(1), w(1), kvm(3), strftime(3), procfs(5), pstat(8), sysctl(8)

The ps command appeared in Version 3 AT&T UNIX in section 8 of the manual.

Since ps cannot run faster than the system and is run as any other scheduled process, the information it displays can never be exact.

August 23, 2016 DragonFly-5.6.1