Information Technology Reference
In-Depth Information
Introduction
This chapter covers controlling programs or processes running on the sys-
tem. This consists of viewing the status of processes, “killing” processes as
needed, and scheduling the automatic startup of processes. The Process
Control test objectives are covered in this chapter.
Viewing and Terminating Processes
The ps(1) , prstat(1M) , and pgrep(1) commands are used to view attributes
of processes, whereas the kill(1) and pkill(1) commands are used to ter-
minate processes. The following sections discuss each of these commands.
The ps Command
The ps command is used to display information about active processes.
Without any command-line arguments, the ps command displays processes
that have the same effective user ID (UID) of the user account that execut-
ed the command. Table 5.1 lists the command-line arguments supported by
the ps command.
Table 5.1
The ps Command-Line Arguments
Argument
Description
-a
Displays all processes except process group leaders and
processes not associated with terminals
-A
Displays all processes (identical to -e )
-c
Displays alternative columns
-d
Displays all processes except process session leaders
-e
Displays all processes
-f
Uses the full listing display format
-g Process Group ID
Displays processes with the specified process group ID
-G Group ID
Displays processes with the specified group ID (GID)
-j
Displays session and process group ID
-l
Uses the long listing display format
-L
Displays information about each lightweight process
-n Name
Uses an alternative name list file (ignored)
-o Format
Uses an alternative display format
-p Process ID
Displays the process with the specified process ID (PID)
(continued)
Search WWH ::




Custom Search