display process status
utility displays information about active
processes. When given no options,
information about processes of the current user that have a controlling
The information displayed is selected based on a set of keywords
(and for even more control, see the
-o options). The
default output format includes, for each process, the process's ID,
controlling terminal, state, CPU time (including both user and system time),
and associated command.
The options are as follows:
The following is a complete list of the available keywords and their meanings.
Several of them have aliases, which are also noted.
- Display information about other users' processes as well as your own.
- Change the way the CPU percentage is calculated by using a
“raw” CPU calculation that ignores “resident”
time (this normally has no effect).
- Do not display full command with arguments, but only the executable name.
This may be somewhat confusing; for example, all
sh(1) scripts will show as
- Display the environment as well.
- Also display information about kernel visible threads.
- 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.
- Also display information about kernel threads.
- List the set of available keywords. This option should not be specified
with other options.
- 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 running kernel.
- Sort by memory usage, instead of by start time ID.
- Extract the name list from the specified system instead of the running
- 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 start time ID.
- 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
- Display the processes belonging to the specified
- Display information associated with the following keywords: user, pid,
%cpu, %mem, vsz, rss, tt, state, start, time, and command. The
-u option implies the
- 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
- When not using the running kernel, extract swap information from the
- Use 132 columns to display information, instead of the default, which is
the window size. If the
-w option is specified
more than once,
ps will use as many columns as
necessary without regard for window size.
- Display information about processes without controlling terminals.
pcpu. 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%.
pmem. The percentage of real memory used by
acflg. Accounting flag.
args. Command and arguments.
- Short-term CPU usage factor (for scheduling).
- CPU ID (zero on single processor systems).
- Current working directory.
- Data size, in Kilobytes.
- Name of system call emulation environment.
f. The union of the flags (in hexadecimal)
associated with the process and the thread as in the include file
PS_CONTROLT 0x2 process has a controlling terminal
P_SIGSUSPEND 0x8 need to restore before-suspend mask
PS_PPWAIT 0x10 parent is waiting for child to
P_PROFIL 0x20 process has started profiling
P_SELECT 0x40 selecting; wakeup/waiting danger
P_SINTR 0x80 sleep is interruptible
PS_SUGID 0x100 process had set ID privileges since
P_SYSTEM 0x200 system process: no sigs, stats, or
P_TIMEOUT 0x400 timing out during sleep
P_TRACED 0x800 process is being traced
P_WAITED 0x1000 debugging process has waited for
P_WEXIT 0x2000 working on exiting
PS_EXEC 0x4000 process called exec(3)
P_OWEUPC 0x8000 owe process an addupc() call at next
PS_ISPWAIT 0x10000 is parent of PPWAIT child
P_SSTEP 0x20000 process needs single-step fixup
PS_SUGIDEXEC 0x40000 last exec(3) was set[ug]id
P_NOZOMBIE 0x100000 pid 1 waits for me instead of dad
P_INEXEC 0x200000 process is doing an exec right now
P_SYSTRACE 0x400000 process system call tracing is active
P_THREAD 0x4000000 only a thread, not a real process
P_IGNEXITRV 0x8000000 for thread kills
P_SOFTDEP 0x10000000 stuck processing softdep worklist
P_STOPPED 0x20000000 just stopped
P_CPUPEG 0x40000000 do not move to another cpu
- Effective group.
- Text name of effective group ID.
inblock. Total blocks read.
- Job control count.
- Tracing flags.
- Tracing vnode.
- The soft limit on memory used, specified via a call to
login. Login name of user who started the
- The exact time the command started, using the “%c” format
- Total page faults.
- Total page reclaims.
- Total messages received (reads from pipes/sockets).
- Total messages sent (writes on pipes/sockets).
ni. The process scheduling increment (see
- Total involuntary context switches.
nsignals. Total signals taken.
- Total swaps in/out.
- Total voluntary context switches.
- Wait channel (as an address).
oublock. Total blocks written.
- Resource usage (valid only for zombie processes).
- Swap address.
- Pageins (same as
- Process group number.
- Process ID.
- Parent process ID.
- Scheduling priority.
- Core residency time (in seconds; 127 = infinity).
- Real group ID.
- Text name of real group ID.
- Reverse link on run queue, or 0.
- The real memory (resident set) size of the process (in 1024 byte
rssize. Resident set size + (text size /
text use count).
- Routing table.
- Real user ID.
- User name (from
- Session pointer.
pending. Pending signals.
caught. Caught signals.
ignored. Ignored signals.
blocked. Blocked signals.
- Sleep time (in seconds; 127 = infinity).
- Stack size, in Kilobytes.
etime. The time the command started. If the
command started less than 24 hours ago, the start time is displayed using
the “%l:%M%p” format described in
strftime(3). If the
command started less than 7 days ago, the start time is displayed using
the “%a%I%p” format. Otherwise, the start time is displayed
using the “%e%b%y” format.
stat. The state is given by a sequence of
letters, for example, “RWN”. The first letter indicates the
run state of the process:
- Marks a process in disk (or other short term, uninterruptible)
- Marks a process that is idle (sleeping for longer than about 20
- Marks a runnable process.
- 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
- The process is in the foreground process group of its control
- The process has a raised CPU scheduling priority (see
- The process has specified a soft limit on memory requirements and is
currently exceeding that limit; such a process is (necessarily) not
- The process is trying to exit.
- The process is a kernel thread.
- The process has a reduced CPU scheduling priority.
- The process is a session leader.
- The process is suspended during a
- The process is being traced or debugged.
- The process is being monitored by
- On multiprocessor machines, specifies processor number
- Saved GID from a setgid executable.
- Saved UID from a setuid executable.
- Control terminal device number.
cputime. Accumulated CPU time, user +
- Control terminal process group ID.
- Control terminal session pointer.
- Text size, in Kilobytes.
- An abbreviation for the pathname of the controlling terminal, if any. The
abbreviation consists of the two letters following
“/dev/tty”, or, for the console, “co”. This is
followed by a ‘-’ if the process can no longer reach that
controlling terminal (i.e. it has been revoked).
- Full name of control terminal.
comm. Name to be used for accounting.
- Effective user ID.
usrpri. Scheduling priority on return from
- User name (from
vsize. Virtual size, in Kilobytes.
- 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
- Exit or stop status (valid only for stopped or zombie process).
- special files and device names
- system namelist database
- /dev name database
ps utility exits 0 on success,
and >0 if an error occurs.
Display information on all system processes:
$ ps -auxw
ps utility is compliant with the
IEEE Std 1003.1-2008 (“POSIX.1”)
The flags [
-CcHhjkLMmNOrST] are extensions
to that specification.
Behaviour for the
-e flag differs between
this implementation and IEEE Std 1003.1-2008
ps command appeared in
Version 3 AT&T UNIX in section 8 of the
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
ps 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
ps cannot run faster than the system and is run as
any other scheduled process, the information it displays can never be exact.