System Administration Guide, Volume 2

Examples--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 process tool commands. Next, the identification number for lpsched is obtained. Finally, output from three process tool commands is shown.


# PATH=$PATH:/usr/proc/bin
# export PATH 1
# ps -e | grep lpsched 2
207 ?        0:00 /usr/lib/lpsched
# pwdx 191 3
207:    /
# ptree 191 4
207   /usr/lib/lpsched
# pfiles 191 5
207:    /usr/lib/lpsched
  Current rlimit: 4096 file descriptors
   0: S_IFIFO mode:0000 dev:179,0 ino:70 uid:0 gid:0 size:0
      O_RDWR
   1: S_IFIFO mode:0000 dev:179,0 ino:70 uid:0 gid:0 size:0
      O_RDWR
   3: S_IFCHR mode:0666 dev:32,8 ino:11446 uid:0 gid:3 rdev:21,0
      O_WRONLY FD_CLOEXEC
   4: S_IFDOOR mode:0444 dev:183,0 ino:59515 uid:0 gid:0 size:0
      O_RDONLY|O_LARGEFILE FD_CLOEXEC  door to nscd[201]
   5: S_IFREG mode:0664 dev:32,9 ino:1330 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 containing lpsched.

  5. Displays fstat and fcntl information.

The following example shows output from the pwait command, which waits until a process terminates, then displays information about what happened. The following example shows output from the pwait command after a Command Tool window was exited.


$ ps -e | grep cmdtool
  273 console 0:01 cmdtool
  277 console 0:01 cmdtool
  281 console 0:01 cmdtool
$ pwait -v 281
281: terminated, wait status 0x0000