System Administration Guide: Advanced Administration

How to Display Information About Processes

  1. Obtain the process ID of the process you want to display more information about.


    # pgrep process
    

    process is the name of the process you want to display more information about.

    The process ID is displayed in the first column of the output.

  2. Display the process information you need.


    # /usr/proc/bin/pcommand pid
    

    pcommand

    Process tool command that you want to run. Table 23–3 lists these commands.

    pid

    Indicates the process ID. 

Example—Displaying Information About Processes

The following example shows how to use process tool commands to display more information about an lpsched process. First, the /usr/proc/bin path is defined to avoid typing long commands. Next, the identification number for the lpsched process is obtained. Finally, output from three process tool commands is shown.


# PATH=$PATH:/usr/proc/bin
# export PATH 1
# pgrep lpsched 2
213
# pwdx 213 3
213:    /
# ptree 213 4
213   /usr/lib/lpsched
# pfiles 213 5
213:    /usr/lib/lpsched
  Current rlimit: 4096 file descriptors
   0: S_IFIFO mode:0000 dev:270,0 ino:67 uid:0 gid:0 size:0
      O_RDWR
   1: S_IFIFO mode:0000 dev:270,0 ino:67 uid:0 gid:0 size:0
      O_RDWR
   3: S_IFCHR mode:0666 dev:136,0 ino:35882 uid:0 gid:3 rdev:21,0
      O_WRONLY FD_CLOEXEC
   4: S_IFDOOR mode:0444 dev:275,0 ino:18526 uid:0 gid:0 size:0
      O_RDONLY|O_LARGEFILE FD_CLOEXEC  door to nscd[208]
   5: S_IFREG mode:0664 dev:136,0 ino:64648 uid:71 gid:8 size:0
      O_WRONLY
  1. Adds the /usr/proc/bin directory to the PATH variable

  2. Obtains the process identification number for lpsched

  3. Displays the current working directory for lpsched

  4. Displays the process tree that containslpsched

  5. Displays fstat and fcntl information