System Administration Guide

Displaying Information About Processes

This section describes commands used to manage process information.

The ps Command

The ps command enables you to check the status of active processes on a system, as well as display technical information about the processes. This data is useful for such administrative tasks as determining how to set process priorities, and how to kill processes that have hung or become inactive.

Depending on which options you use, ps reports the following information:

Table 63-1 describes some of the fields reported by the ps command. The fields displayed depend on which option you choose. See ps(1) for a description of all available options.

Table 63-1 Summary of Fields in ps Reports

Field 

Description 

UID

The effective user ID of the process's owner. 

PID

The process ID. 

PPID

The parent process's ID. 

C

The processor utilization for scheduling. This field is not displayed when the -c option is used.

CLS

The scheduling class to which the process belongs: real-time, system, or timesharing. This field is included only with the -c option.

PRI

The kernel thread's scheduling priority. Higher numbers mean higher priority. 

NI

The process's nice number, which contributes to its scheduling priority. Making a process "nicer" means lowering its priority.

ADDR

The address of the proc structure.

SZ

The virtual address size of the process. 

WCHAN

The address of an event or lock for which the process is sleeping.  

STIME

The starting time of the process (in hours, minutes, and seconds). 

TTY

The terminal from which the process (or its parent) was started. A question mark indicates there is no controlling terminal. 

TIME

The total amount of CPU time used by the process since it began. 

CMD

The command that generated the process.  

How to List Processes

To list all the processes being executed on a system, use the ps command.


$ ps [-ef]

ps

Displays only the processes associated with your login session. 

-ef

Displays full information about all the processes being executed on the system. 

Example--Listing Processes

The following example shows output from the ps command when no options are used.


$ ps
   PID TTY      TIME COMD
  1664 pts/4    0:06 csh
  2081 pts/4    0:00 ps

The following example shows output from ps -ef. This shows that the first process executed when the system boots is sched (the swapper) followed by the init process, pageout, and so on.


$ ps -ef
     UID   PID  PPID  C    STIME TTY     TIME CMD
    root     0     0  0   May 05 ?       0:04 sched
    root     1     0  0   May 05 ?      10:48 /etc/init -
    root     2     0  0   May 05 ?       0:00 pageout
    root     3     0  0   May 05 ?      43:21 fsflush
    root   238     1  0   May 05 ?       0:00 /usr/lib/saf/sac -t 300
    root   115     1  0   May 05 ?       0:10 /usr/sbin/rpcbind
    root   158     1  0   May 05 ?       0:00 /usr/lib/autofs/autom...
    root   134     1  0   May 05 ?       0:12 /usr/sbin/inetd -s
    root   107     1  0   May 05 ?      11:49 /usr/sbin/in.routed -q
    root   117     1  5   May 05 ?     899:32 /usr/sbin/keyserv
    root   125     1  0   May 05 ?       0:00 /usr/sbin/kerbd
    root   123     1  0   May 05 ?       4:17 /usr/sbin/nis_cachemgr
    root   137     1  0   May 05 ?       0:00 /usr/lib/nfs/statd
    root   139     1  0   May 05 ?       0:02 /usr/lib/nfs/lockd
    root   159     1 50   May 05 ?    8243:36 /usr/sbin/automount
    root   199   191  0   May 05 ?       0:00 lpNet
    root   162     1  0   May 05 ?       0:07 /usr/sbin/syslogd
    root   181     1  0   May 05 ?       0:03 /usr/sbin/nscd... 
    root   169     1  0   May 05 ?       5:09 /usr/sbin/cron
    root   191     1  0   May 05 ?       0:00 /usr/lib/lpsched
    root   210     1  0   May 05 ?       0:01 /usr/sbin/vold
    root   200     1  0   May 05 ?       0:08 /usr/lib/sendmail -bd -q1h
    root  4942     1  0   May 17 console 0:00 /usr/lib/saf/ttymon...
    root   208     1  0   May 05 ?       0:00 /usr/lib/utmpd
    root   241   238  0   May 05 ?       0:00 /usr/lib/saf/ttymon
    root  5748   134  0 17:09:49 ?       0:01 in.rlogind
    root  5750  5748  0 17:09:52 pts/0   0:00 -sh
    root  5770  5750  2 17:23:39 pts/0   0:00 ps -ef