La commande 'procfiles' permet de lister les informations des objets ouverts par un processus.
La syntaxe la plus simple est '# procfiles PID'
Des options peuvent être ajoutées pour le format('-c') ou les traduction('-n').
# procfiles -c 6947028
6947028 : /usr/sbin/cron
Current rlimit: 8192 file descriptors
---------------------------------------------------------------------------------------------------------------
FD TYPE MODE DEV/RDEV UID GID OPMOD INODE
---------------------------------------------------------------------------------------------------------------
0 c --------- 10, 4( 2, 2) root cron cron 8962
1 - -w--w---- 10, 6 root cron W|A 56
2 - -w--w---- 10, 6 root cron W|A 56
3 d rwxr-xr-x 10, 5 bin bin R 47
4 d rwxr-xr-x 10, 5 bin bin R 70169
5 d r-xr-xr-x 10, 5 root system R 2
6 d rwxr-xr-x 10, 5 bin bin R 47
7 d rwxr-xr-x 10, 5 bin bin R 70169
8 d r-xr-xr-x 10, 4 root system R 416
9 d rwxrwxrwt 10, 7 root system R 2
10 d rwxrwxr-x 10, 6 root adm R 32
11 p --------- 10, 6 root cron R-W 53
13 - r--r--r-- 10, 5 root cron R 90512
# procfiles -n 6947028
6947028 : /usr/sbin/cron
Current rlimit: 8192 file descriptors
0: S_IFCHR mode:00 dev:10,4 ino:8962 uid:0 gid:8 rdev:2,2
O_RDONLY name://dev/null
1: S_IFREG mode:0220 dev:10,6 ino:56 uid:0 gid:8 rdev:0,0
O_WRONLY | O_APPEND size:0 name:/var/adm/cron/log
2: S_IFREG mode:0220 dev:10,6 ino:56 uid:0 gid:8 rdev:0,0
O_WRONLY | O_APPEND size:0 name:/var/adm/cron/log
3: S_IFDIR mode:0755 dev:10,5 ino:47 uid:2 gid:2 rdev:0,0
O_RDONLY name:/usr/bin
4: S_IFDIR mode:0755 dev:10,5 ino:70169 uid:2 gid:2 rdev:0,0
O_RDONLY name:/usr/lib
5: S_IFDIR mode:0555 dev:10,5 ino:2 uid:0 gid:0 rdev:0,0
O_RDONLY name:/usr
6: S_IFDIR mode:0755 dev:10,5 ino:47 uid:2 gid:2 rdev:0,0
O_RDONLY name:/usr/bin
7: S_IFDIR mode:0755 dev:10,5 ino:70169 uid:2 gid:2 rdev:0,0
O_RDONLY name:/usr/lib
8: S_IFDIR mode:0555 dev:10,4 ino:416 uid:0 gid:0 rdev:0,0
O_RDONLY name://etc
9: S_IFDIR mode:01777 dev:10,7 ino:2 uid:0 gid:0 rdev:0,0
O_RDONLY name:/tmp
10: S_IFDIR mode:0775 dev:10,6 ino:32 uid:0 gid:4 rdev:0,0
O_RDONLY name:/var/adm
11: S_IFIFO mode:00 dev:10,6 ino:53 uid:0 gid:8 rdev:0,0
O_RDWR name:/var/adm/cron/FIFO
13: S_IFREG mode:0444 dev:10,5 ino:90512 uid:0 gid:8 rdev:0,0
O_RDONLY size:0 name:/usr/lib/nls/msg/en_US/cron.cat
# procfiles -cn 6947028
6947028 : /usr/sbin/cron
Current rlimit: 8192 file descriptors
---------------------------------------------------------------------------------------------------------------
FD TYPE MODE DEV/RDEV UID GID OPMOD NAME
---------------------------------------------------------------------------------------------------------------
0 c --------- 10, 4( 2, 2) root cron R //dev/null
1 - -w--w---- 10, 6 root cron W|A /var/adm/cron/log
2 - -w--w---- 10, 6 root cron W|A /var/adm/cron/log
3 d rwxr-xr-x 10, 5 bin bin R /usr/bin
4 d rwxr-xr-x 10, 5 bin bin R /usr/lib
5 d r-xr-xr-x 10, 5 root system R /usr
6 d rwxr-xr-x 10, 5 bin bin R /usr/bin
7 d rwxr-xr-x 10, 5 bin bin R /usr/lib
8 d r-xr-xr-x 10, 4 root system R //etc
9 d rwxrwxrwt 10, 7 root system R /tmp
10 d rwxrwxr-x 10, 6 root adm R /var/adm
11 p --------- 10, 6 root cron R-W /var/adm/cron/FIFO
13 - r--r--r-- 10, 5 root cron R /usr/lib/nls/msg/en_US/cron.cat
Ci-dessous la documentation officielle IBM.
procfiles Command
Purpose
Reports information about all file descriptors opened by processes.
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
- To display status and control information on the file descriptors opened by process 11928, enter the following command:
The output of this command might look like this:procfiles 11928
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
- To display name, status and control information on the file descriptors opened by process 15502, enter the following command:
The output of this command might look like this:procfiles -n 15502
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
- To display status and control information on the file descriptors opened by the 278684 process, enter the following command:
The output of this command might look like this:procfiles -c 278684
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