The ps (process status) command is one of the most frequently used commands in Linux. Usually it is used to get the more and detailed information about a specific process or all processes. For example it is used to know whether a particular process is running or not, who is running what process in system, which process is using higher memory or CPU, how long a process is running, etc.
Without any option and argument, the ps command shows only the process running under the logged in user account from the current terminal.
To print all running processes in system, use any one of the following commands.
$ps –A $ps -e
The options A and e provide summarized overview of running processes. To print the detailed overview, use the options f (full format) and F (extra full format) with these options.
To view the same output in BSD Unix style, use the options "aux".
The ps aux command output description column by column
Column | Description |
USER | The user account under which this process is running |
PID | Process ID of this process |
%CPU | CPU time used by this process (in percentage). |
%MEM | Physical memory used by this process (in percentage). |
VSZ | Virtual memory used by this process (in bytes). |
RSS | Resident Set Size, the non-swappable physical memory used by this process (in KiB) |
TTY | Terminal from which this process is started. Question mark (?) sign represents that this process is not started from a terminal. |
STAT | Process state. Explained in next table. |
START | Starting time and date of this process |
TIME | Total CPU time used by this process |
COMMAND | The command with all its arguments which started this process |
ps aux stat code with description
D | uninterruptible sleep (usually IO) |
R | running or runnable (on run queue) |
S | interruptible sleep (waiting for an event to complete) |
T | stopped by job control signal |
t | stopped by debugger during the tracing |
w | paging (not valid since the 2.6.xx kernel) |
x | dead (should never be seen) |
Z | defunct ("zombie") process, terminated but not reaped by its parent |
< | high-priority (not nice to other users) |
N | low-priority (nice to other users) |
L | has pages locked into memory (for real-time and custom IO) |
s | is a session leader |
l | is multi-threaded (using CLONE_THREAD, like NPTL pthreads do) |
+ | is in the foreground process group |
To display all process in hierarchy, we can use the following command.
ps -A --forest
From: