HP NonStop G-Series User Manual

Page 140

Advertising
background image

You can also check the status of a particular process by using the -p flag and the process ID with
the ps command. The general format for checking the status of a particular process is the following:

ps -pprocess_ID

The ps command also displays the status of background processes. If there are any background
processes running, they are displayed along with the foreground processes. The following example
shows how to start a find background process and then check its status:

$ find / -type f -print >dirpaths &

25

$ ps -p25

PID TTY TIME CMD

25 console 00:40 find

You can check background process status as often as you want while the process runs. In the
following example, the ps command displays the status of the preceding find process five times:

$ ps -p25

PID TTY TIME CMD

25 console 00:18 find

$ ps -p25

PID TTY TIME CMD

25 console 00:29 find

$ ps -p25

PID TTY TIME CMD

25 console 00:49 find

$ ps -p25

PID TTY TIME CMD

25 console 00:58 find

$ ps -p25

PID TTY TIME CMD

25 console 01:02 find

$ ps -p25

Notice that the sixth ps command returns no status information because the find process ended
before that ps command was entered.

The ps command also displays the status of zombie processes, which are processes that have
terminated but are still recorded in the system tables. A zombie process is indicated by the symbol
<defunct>

in the COMMAND column, as in the following example:

$ ps

PID TTY TIME CMD

38596 #ptmykzh 00:00 /bin/-sh

140 Managing Processes

Advertising
This manual is related to the following products: