HP NonStop G-Series User Manual

Page 142

Advertising
background image

The general format for terminating a process is as follows:

kill process_ID

If you wish to end all the processes you have started since starting Open System Services, use the
kill 0

command. You do not have to know the process IDs to use kill 0. Because this command

deletes all of your processes, use it with care.

The following example shows how to start another find process, check its status, and then terminate
it with the kill command.

$ find / -type f -print >dirpaths &

[3] 738

$ ps

PID TTY STAT TIME CMD

520 p4 I 00:11 sh

738 p5 I 00:10 find

1216 p6 S 00:01 qdaemon

839 p7 R 00:03 ps

$ kill 738

$ ps

[3] Terminated

PID TT STAT TIME CMD

520 p4 I 00:11 sh

1216 p6 S 00:01 qdaemon

839 p7 R 00:03 ps

The command kill 738 stops the background find process. The second ps command returns
no status information about process ID 738. The system does not display the termination message
until you enter your next command. Note that, in this example, kill 738 and kill 0 would
have the same effect because only one process was started from this workstation.

Displaying Information About Users and Their Processes

Open System Services provides the following commands to indicate who is running Open System
Services and what they are doing:

Displays the users currently logged on.

who

Displays the users currently logged on and information about processes they are running.

ps -fu

The who command allows you to determine who is logged on to the system.

In the following example, a list of all users currently logged on is displayed:

$ who

QADEV.ANDY /G/ztnt/#pty0051 Oct 20 18:17

SOFTDEV.ROB /G/ztnt/#pty005l Oct 21 13:22

SOFTWARE.REG /G/ztnt/#pty005n Oct 21 14:24

142

Managing Processes

Advertising
This manual is related to the following products: