Monitoring and canceling processes, Checking process status, The ps command – HP NonStop G-Series User Manual

Page 139

Advertising
background image

$ find / -type f -print > dirpaths &

[1] 24

When the background process starts, the system assigns it a job number and a process ID and
displays them. In this example, [1] is the job number and 24 is the process ID. (Your process ID
will be different from the one shown in this and following examples.)

You can then check the status of the process with the jobs command. You can also terminate a
process with the kill command. See

“Monitoring and Canceling Processes” (page 139)

for more

information on these commands.

Monitoring and Canceling Processes

Use the ps (process status) command to find out which processes are running and to display
information about them.

Use the jobs command to monitor background processes.

Use the kill command or Ctrl-c to cancel (stop) a process before it is finished.

Checking Process Status

The ps command allows you to monitor the status of all active processes, both foreground and
background, associated with your workstation.

Use the jobs command to monitor the status of all active background processes associated with
your workstation.

The ps Command

The ps command has the following form:

ps

In the following example, the ps command displays the status of all processes associated with
your workstation:

$ ps

PID TTY TIME CMD

29670 p4 00:00 /bin/-sh

515 p5 00:00 /bin/-sh

28476 p5 00:00 ps

790 p6 00:00 /bin/-sh

The display headings indicate the following:

Process identification (process ID). The system assigns a process ID to each process when that process
starts. There is no special relationship between an individual process and a particular process ID; thus,
if you start the same process several times, it will have a different process ID each time.

PID

Controlling tty device name. On a system with more than one workstation, this field tells you which
workstation started the process. On a system with only one workstation, this field can contain the
designation console or the designation for one or more virtual terminals.

TTY

Time devoted to this process by the computer, displayed in minutes and seconds starting when you
enter ps.

TIME

The name of the command (or program) that started the process.

CMD

Monitoring and Canceling Processes

139

Advertising
This manual is related to the following products: