ps
ps (short for process status) is a tool for reporting on a system's active processes. It has a long history on Unix-like operating systems such as BSD and Linux. Consequently, it accepts a very wide variety of input flags in one of three forms: Unix-style options preceded by a single dash, BSD-style options which do not have a dash, and GNU long options which are preceded by two dashes.
Installation
USE flags
USE flags for sys-process/procps Standard informational utilities and process-handling tools
+kill
|
Build the kill program |
+ncurses
|
Build programs that use ncurses: top, slabtop, watch |
elogind
|
Use sys-auth/elogind for session tracking. |
modern-top
|
Enables new startup defaults of top. Keeps old defaults if disabled |
nls
|
Add Native Language Support (using gettext - GNU locale utilities) |
selinux
|
!!internal use only!! Security Enhanced Linux support, this must be set by the selinux profile or breakage will occur |
skill
|
Build the skill and snice programs |
split-usr
|
Enable behavior to support maintaining /bin, /lib*, /sbin and /usr/sbin separately from /usr/bin and /usr/lib* |
static-libs
|
Build static versions of dynamic libraries as well |
systemd
|
Enable use of systemd-specific libraries and features like socket activation or session tracking |
test
|
Enable dependencies and/or preparations necessary to run tests (usually controlled by FEATURES=test but can be toggled independently) |
unicode
|
Add support for Unicode |
Emerge
sys-process/procps is part of the @system set, so it should be installed by default.
In case it is ever needed, reinstall sys-process/procps:
root #
emerge --ask --oneshot sys-process/procps
Configuration
Environment variables
- $PS_FORMAT — override the default output format.
Files
- /proc — the virtual file system ps reads to obtain the information required for its reports.
Usage
Invocation
To see options available to the ps command:
user $
ps --help all
Show all running processes
ps may be used to show all running processes by using the a
, u
, and x
, options (see invocation section on what these options do):
user $
ps aux
Tips
Find a specific process
To find details of a specific process by name, the ps command output may be piped to grep:
user $
ps aux | grep <process name>
See also
- htop — a cross-platform interactive process viewer. It is a text-mode application (for console or X terminals) and requires ncurses.