Previous Table of Contents Next


Commands for Monitoring Processes

The ps ( process status) command is your main tool for obtaining information about processes. You can use the ps command in combination with the grep command to focus your search for specific information.

You can also use the dispadmin, priocntl, and nice commands to manage processes. Table 1-2 lists the commands for managing processes.

Table 1-2 Commands for Managing Processes

Command Description
ps Check the status of active processes on a system and display detailed information about the processes.
dispadmin List default scheduling policies.
priocntl Assign processes to a priority class and manage process priorities.
nice Change the priority of a timesharing process.

Refer to the ps(1M), dispadmin(1M), priocntl(1M), and nice(1M) manual pages for complete information about these commands.

In addition, the /usr/proc/bin directory contains process tools that you can use to display highly detailed information about the processes listed in /proc. The /proc directory is also known as the process file system (procfs). It stores images of active processes by their process ID number. For more information about the /proc file system see "Types of File Systems" on page 145.

The process tools are similar to some options of the ps command, except that the output provided by the tools is more detailed. In general, the process tools:

  Display more details about processes, such as fstat and fcntl information, working directories, and trees of parent and child processes
  Provide control over processes, enabling users to stop or resume them

Table 1-3 summarizes the new /usr/proc/bin utilities.

Table 1-3 Process Tools in the /usr/proc/bin Directory

Command Description
pstop pid Stop the process.
prun pid Restart the process.
ptime pid Time the process using microstate accounting.
pwait pid Wait for the specified processes to terminate.
pcred pid Display credentials.
pfiles pid Display fstat and fcntl information for open files.
pflags pid Show /proc tracing flags, pending and held signals, and other status information for each lwp.
pldd pid Show dynamic libraries linked into each process.
pmap pid Show address map space.
psig pid Display signal actions.
pstack pid Display hex+symbolic stack trace for each lwp.
ptree pid Show process trees containing specified PIDs.
pwdx pid Display current working directory.

For a complete description of the process tools, refer to the proc(1) manual page. For information about how to use the process tools commands to display details about processes and start and stop them, see "Using the /usr/proc/bin Commands."

The ps Command

You can use the ps command to determine which processes are running (or not running) and get detailed information about an individual process, such as:

  PID ( process ID)
  UID (user ID)
  Priority
  Control terminal
  Memory use
  CPU time
  Current status

The ps command takes a snapshot of system activity at the time you type the command. If you are monitoring system activity by time, be aware that the results are already slightly out-of-date by the time you read them. Table 1-4 shows the most frequently used options for the ps command. See the ps(1) manual page for a complete list of options.

Table 1-4 Most Frequently Used Options for the ps Command

Option Description
-e Report on all processes.
-f Show the owner of the process, by name instead of by UID, in the first column. This option turns off -1, -t, -s, and -r and turns on -a.
-l Generate a long report, which includes all fields except STIME.


Previous Table of Contents Next