procfiles Command

Purpose

Reports information about all file descriptors opened by processes.

Syntax

procfiles [ -F ] [ -n ] [ -c ] ProcessID ...

Description

The /proc filesystem provides a mechanism to control processes. It also gives access to information about the current state of processes and threads, but in binary form. The proctools commands provide ASCIIi reports based on some of the available information.

Most of the commands take a list of process IDs or /proc/ProcessID strings as input. The shell expansion /proc/* can therefore be used to specify all processes in the system.

Each of the proctools commands gathers information from /proc for the specified processes and displays it to the user. The proctools commands like procrun and procstop start and stop a process using the /proc interface.

The information gathered by the commands from /proc is a snapshot of the current state of processes, and therefore can vary at any instant except for stopped processes.

Regular files have permission based on mode it was opened with. Any non-regular files have 0 access mode.

The procfiles command reports information on all file descriptors opened by processes. With the -n option it also displays the names of the corresponding files.

Flags

Item Description
-c Prints the output in column format.
-F Forces procfiles to take control of the target process even if another process has control.
-n Prints the names of the files referred to by file descriptors.
ProcessID Specifies the process id.

Examples

  1. To display status and control information on the file descriptors opened by process 11928, enter the following command:
    procfiles 11928
    The output of this command might look like this:
    11928 : -sh
      Current rlimit: 2000 file descriptors
       0: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1
          O_RDONLY
       1: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1
          O_RDONLY
       2: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1
          O_RDONLY
       63: S_IFREG mode:0600 dev:10,8  ino:311 uid:100 gid:100 rdev:40960,10317
          O_RDONLY size:2574
  2. To display name, status and control information on the file descriptors opened by process 15502, enter the following command:
    procfiles -n 15502
    The output of this command might look like this:
    15502 : /home/guest/test 
      Current rlimit: 2000 file descriptors                                 
       0: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1
          O_RDONLY
       1: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1
          O_RDONLY
       2: S_IFCHR mode:0622 dev:10,4  ino:2584 uid:100 gid:100 rdev:28,1
          O_RDONLY
       3: S_IFREG mode:0644 dev:10,7  ino:26 uid:100 gid:100 rdev:0,0       
          O_RDONLY size:0  name:/tmp/foo
  3. To display status and control information on the file descriptors opened by the 278684 process, enter the following command:
    procfiles -c 278684
    The output of this command might look like this:
    278684 : -ksh
      Current rlimit: 2000 file descriptors
    --------------------------------------------------------------------------------
     FD   TYPE   MODE      DEV/RDEV     UID       GID          OPMOD           INODE
    --------------------------------------------------------------------------------
     0     c   ---------  10, 4(19, 0)  root      system        R-W            16385
     1     c   ---------  10, 4(19, 0)  root      system        R-W            16385
     2     c   ---------  10, 4(19, 0)  root      system        R-W            16385
     61    -   rw-r--r--  10, 7         root      system        R-W            32
     63    -   rw-------  10, 4         root      system        R-W | A        1051

Files

Item Description
/proc Contains the /proc filesystem.