Reports information about all file descriptors opened by processes.
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.
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. |
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
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
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
Item | Description |
---|---|
/proc | Contains the /proc filesystem. |