HOME

TheInfoList



OR:

In most
Unix Unix (; trademarked as UNIX) is a family of multitasking, multiuser computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, and ot ...
and Unix-like
operating systems An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
, the ps program (short for "process status") displays the currently-running processes. A related Unix utility named
top A spinning top, or simply a top, is a toy with a squat body and a sharp point at the bottom, designed to be spun on its vertical axis, balancing on the tip due to the gyroscopic effect. Once set in motion, a top will usually wobble for a few ...
provides a real-time view of the running processes.


Implementations

KolibriOS KolibriOS, or Kolibri, is a small, open-source x86 operating system written completely in assembly. It was forked from MenuetOS in 2004 and has run under independent development since. In a 2009 review piece on alternative operating systems, ' ...
includes an implementation of the
command Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
. The command has also been ported to the
IBM i IBM i (the ''i'' standing for ''integrated'') is an operating system developed by IBM for IBM Power Systems. It was originally released in 1988 as OS/400, as the sole operating system of the IBM AS/400 line of systems. It was renamed to i5/OS in ...
operating system. In
Windows PowerShell PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-sourc ...
, ps is a predefined command alias for the Get-Process cmdlet, which essentially serves the same purpose.


Examples

# ps PID TTY TIME CMD 7431 pts/0 00:00:00 su 7434 pts/0 00:00:00 bash 18585 pts/0 00:00:00 ps Users can
pipeline Pipeline may refer to: Electronics, computers and computing * Pipeline (computing), a chain of data-processing stages or a CPU optimization found on ** Instruction pipelining, a technique for implementing instruction-level parallelism within a s ...
ps with other commands, such as
less Less or LESS may refer to: fewer than,: not as much. Computing * less (Unix) less is a terminal pager program on Unix, Windows, and Unix-like systems used to view (but not change) the contents of a text file one screen at a time. It is simila ...
to view the process status output one page at a time: $ ps -A , less Users can also utilize the ps command in conjunction with the
grep grep is a command-line utility for searching plain-text data sets for lines that match a regular expression. Its name comes from the ed command ''g/re/p'' (''globally search for a regular expression and print matching lines''), which has the sa ...
command (see the
pgrep pgrep is a command-line utility initially written for use with the Solaris 7 operating system by Mike Shapiro. It has since been available in illumos and reimplemented for the Linux and BSDs (DragonFly BSD, FreeBSD, NetBSD, and OpenBSD). It se ...
and pkill commands) to find information about a single process, such as its id: $ # Trying to find the PID of `firefox-bin` which is 2701 $ ps -A , grep firefox-bin 2701 ? 22:16:04 firefox-bin The use of
pgrep pgrep is a command-line utility initially written for use with the Solaris 7 operating system by Mike Shapiro. It has since been available in illumos and reimplemented for the Linux and BSDs (DragonFly BSD, FreeBSD, NetBSD, and OpenBSD). It se ...
simplifies the syntax and avoids potential race conditions: $ pgrep -l firefox-bin 2701 firefox-bin To see every process running as root in user format: # ps -U root -u USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND root 1 0.0 0.0 9436 128 - ILs Sun00AM 0:00.12 /sbin/init --


Header line

* = Often abbreviated


Options

ps has many options. On
operating system An operating system (OS) is system software that manages computer hardware, software resources, and provides common daemon (computing), services for computer programs. Time-sharing operating systems scheduler (computing), schedule tasks for ef ...
s that support the SUS and
POSIX The Portable Operating System Interface (POSIX) is a family of standards specified by the IEEE Computer Society for maintaining compatibility between operating systems. POSIX defines both the system- and user-level application programming interf ...
standards, ps commonly runs with the options -ef, where "-e" selects every process and "-f" chooses the "full" output format. Another common option on these systems is -l, which specifies the "long" output format. Most systems derived from
BSD The Berkeley Software Distribution or Berkeley Standard Distribution (BSD) is a discontinued operating system based on Research Unix, developed and distributed by the Computer Systems Research Group (CSRG) at the University of California, Berke ...
fail to accept the SUS and POSIX standard options because of historical conflicts. (For example, the "e" or "-e" option will display
environment variable An environment variable is a dynamic-named value that can affect the way running processes will behave on a computer. They are part of the environment in which a process runs. For example, a running process can query the value of the TEMP en ...
s.) On such systems, ps commonly runs with the non-standard options aux, where "a" lists all processes on a terminal, including those of other users, "x" lists all processes without controlling terminals and "u" adds a column for the controlling user for each process. For maximum compatibility, there is no "-" in front of the "aux". "ps auxww" provides complete information about the process, including all parameters.


See also

*
Task manager In operating systems, a task manager is a system monitor program used to provide information about the processes and applications running on a computer, as well as the general status of the computer. Some implementations can also be used to ...
*
kill (command) In computing, kill is a command that is used in several popular operating systems to send signals to running processes. Implementations Unix and Unix-like In Unix and Unix-like operating systems, kill is a command used to send a signal to a ...
*
List of Unix commands This is a list of Unix commands as specified by IEEE Std 1003.1-2008, which is part of the Single UNIX Specification (SUS). These commands can be found on Unix operating systems and most Unix-like operating systems. List See also * List of ...
*
nmon nmon (''Nigel's Monitor'') is a computer performance system monitor tool for the AIX and Linux operating systems. The nmon tool has two modes a) displays the performance stats on-screen in a condensed format or b) the same stats are saved to a co ...
— a system monitor tool for the AIX and Linux operating systems. *
pgrep pgrep is a command-line utility initially written for use with the Solaris 7 operating system by Mike Shapiro. It has since been available in illumos and reimplemented for the Linux and BSDs (DragonFly BSD, FreeBSD, NetBSD, and OpenBSD). It se ...
* pstree (Unix) *
top (Unix) top (table of processes) is a task manager program, found in many Unix-like operating systems, that displays information about CPU and memory utilization. Overview The program produces an ordered list of running processes selected by user-speci ...
*
lsof lsof is a command meaning "list open files", which is used in many Unix-like systems to report a list of all open files and the processes that opened them. This open source utility was developed and supported by Victor A. Abell, the retired Asso ...


References


Further reading

* *


External links

* * *
Show all running processes in Linux using ps command


{{lowercase Unix SUS2008 utilities Unix process- and task-management-related software Plan 9 commands Inferno (operating system) commands IBM i Qshell commands