20.3 Listing Processes

   

Processes are listed using the ps command. The ps command listed without arguments will display all processes owned by the user who issued the command. A typical output of the command is shown next .

 $  ps  PID TTY          TIME CMD 17838 pts/ta      00:00 -sh 21828 pts/ta      00:00 ps 17817 pts/ta      00:00 telnetd $ 

To list all processes, you can use the -ef option with the ps command.

 #  ps -ef  UID     PID  PPID C  STIME  TTY    TIME  CMD root     0     0  0  Nov  9  ?     00:11 swapper root     1     0  0  Nov  9  ?     00:01 init root     2     0  0  Nov  9  ?     00:00 vhand root     3     0  1  Nov  9  ?     00:42 statdaemon root     4     0  0  Nov  9  ?     00:01 unhashdaemon root     8     0  0  Nov  9  ?     00:00 supsched root     9     0  0  Nov  9  ?     00:00 strmem root     10    0  0  Nov  9  ?     00:00 strweld root     11    0  0  Nov  9  ?     00:00 strfreebd root     12    0  0  Nov  9  ?     00:00 ttisr root     18    0  0  Nov  9  ?     00:00 lvmkd root     19    0  0  Nov  9  ?     00:00 lvmkd root     20    0  0  Nov  9  ?     00:00 lvmkd root     21    0  0  Nov  9  ?     00:00 lvmkd root     22    0  0  Nov  9  ?     00:00 lvmkd root     23    0  0  Nov  9  ?     00:00 lvmkd root     24    0  0  Nov  9  ?     00:00 smpsched root     25    0  0  Nov  9  ?     00:00 smpsched root     26    0  0  Nov  9  ?     00:00 smpsched root     27    0  0  Nov  9  ?     00:00 smpsched root     28    0  0  Nov  9  ?     00:00 smpsched root   2007    1  0  Oct 19  ?     0:00 /usr/sbin/rpcbind root   2949    1  0  Oct 19  ?     0:00 /usr/sbin/nfsd 4 root     28    0  0  Oct 19  ?     8:04 vxfsd root    488    1  0  Oct 19  ?     0:00 /usr/sbin/ptydaemon root   2683    1  0  Oct 19  ?     0:00 /usr/sbin/cron root   2456    1  0  Oct 19  ?     0:00 /usr/sbin/snmpdm root   2110    1  0  Oct 19  ?     0:00 /usr/sbin/inetd root   2907    1  0  Oct 19  ?     5:50 /usr/sbin/swagentd root   2760    1  0  Oct 19  ?     0:00 /opt/perf/bin/ttd root   2502    1  0  Oct 19  ?     9:01 /usr/sbin/mib2agt 

This list of processes has been truncated. Depending on the applications used on your system, this process list may be quite long.

Description of Fields in the Process Table

A brief description of the different fields used in the output of the ps command are as follows .

UID User ID of the owner of the process.
PID Process ID, a number used to represent a process in the process table.
PPID Process ID of the parent process. Your shell is the parent process of all processes created by the commands you use.
C Processor utilization for scheduling.
STIME Starting time of the process. If the difference between the starting time and the current time is more than 24 hours, the starting date is specified.
TTY Controlling terminal of the process, usually the terminal device file used by a terminal. A question mark may be present if there is no controlling terminal; most of the processes started at boot time do not have one.
TIME Cumulative execution time for the process.
CMD Command name that initiated the process.

If you use the -l option with the ps command, other fields are displayed. Some of the important fields are listed here.

NI Nice priority value of the process. This is a number ranging from 0 to 39, used for priority calculation by the kernel for process scheduling. (This will be discussed later in this chapter.)
F Flag field that shows a number of things, including if the process is swapped out of or into the main memory. This also shows if the process is a system process.
ADDR Memory address of the process.
%CPU Percentage of CPU time used by the process.
S State of the process (running, sleeping, stopped , etc.).
SZ Size of the core of the process image in number of pages.
WCHAN Event for which the process is waiting. If the process is not sleeping or waiting for any event, a hyphen is placed in this column.

   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net