Thursday, May 27, 2010

In Unix, what do the output fields of the ps command mean?

The ps command varies significantly among Unix implementations. Each vendor incorporates its own flags and outputs the results differently. However, most ps variants are rooted enough in either the System V or BSD syntax that entering ps -elf (System V) or ps alx (BSD) will produce something like the following:

F S UID ID PPID C PRI NI ADDR SZ WCHAN STIME TTY TIME COMD
1 R obiwan 792 779 22 183 20 10ec5f80 29 - 12:52:24 pts/2 0:00 ps -elf
1 S root 24621 560 0 154 20 13603f80 11 4697c0 Jun 16 ttyp2 0:00 telnetd
1 S dvader 1162 1153 0 154 20 110a1f80 77 452be4 11:25:41 pts/3 0:00 ssh deathstar

This particular example is from HP-UX, whose output is basically vanilla System V. The following table describes the meanings of the columns that commonly appear in ps outputs. No version of ps will display all of these fields, however.

Column Header Contents

--------------------------------------------------------------------------------

%CPU How much of the CPU the process is using
%MEM How much memory the process is using
ADDR Memory address of the process
C or CP CPU usage and scheduling information
COMMAND* Name of the process, including arguments, if any
NI nice value
F Flags
PID Process ID number
PPID ID number of the process's parent process
PRI Priority of the process
RSS Real memory usage
S or STAT Process status code
START or STIME Time when the process started
SZ Virtual memory usage
TIME Total CPU usage
TT or TTY Terminal associated with the process
UID or USER Username of the process's owner
WCHAN Memory address of the event the process is waiting for

* = Often abbreviated

For information specific to your Unix implementation, consult the ps man page

No comments:

Post a Comment