![]() Lsof indicates if the file descriptor is associated with an open socket or an open file. lsof is a very powerful command with many options so we only list a few uses for lsof in this document.ĭisplays the total number of open file handles in the specified account.ĭisplays the total number of open files in the specified account name for the specified pid. The lsof command is an open source command available for free on the internet. In this example we see that cron has 13 opened files, numbered from 0 to 12. We can use the slot number to display the file system state info and the file descriptor table. The PID for cron is 323762, which is 0x4F0B2 in hex. Here is an example that finds all files currently opened by the cron process. The AIX pstat command can be used to list all files opened by a process. This indicates that there is only 1 hard link, meaning the file name hostmibd.cat is the only file name associated with this inode. We can use find command to find all file names in the filesystem /usr with an inode of 13407. We can use the following command to obtain information about the file with file descriptor 4 and inode 13407. So the device or logical volume that contains the file system in this example is /dev/hd2. We can use the following procedure to find the device where the file is located. File descriptor 4 has major,minor numbers of 10,5 and an inode number of 13407. ![]() Here is an example of procfiles output for the same process with PID 184422 that we found in the /proc file system above.Ĭurrent rlimit: 2147483647 file descriptorsĤ: S_IFREG mode:0444 dev:10,5 ino:13407 uid:0 gid:0 rdev:0,0Īgain we see that process 184422 has one opened file with file descriptor 4. For each file the command also provides the inode number for the file, and additional information such as the file size, and uid and gid. The AIX procfiles command lists all files opened by a process. # ls -l total 16 -r-r-r- 1 root system 4811 4 ![]() In the following example, we find that the process with PID 184422 has only one opened file with file descriptor 4. These numbers are the file descriptor numbers assigned by the operating system to the real files that have been opened by the process. Inside fd is a list of virtual files with numbers for file names. One of the subdirectories is named fd, an abbreviation for file descriptor. These subdirectories organize all of the available information about running processes. Inside of each of these directories are more subdirectories. Under /proc there are virtual directories named with the process IDs (PIDs) of all processes currently running on the system. These virtual files provide information about processes currently running on a system, using standard UNIX commands and methods for accessing files. But the /proc file system contains virtual files that can be manipulated just like real files. The /proc file system is a virtual file system, meaning it does not contain actual files residing on a disk or in RAM. Open Source commands such as lsof can also be used. AIX also includes a number of commands that can be used to obtain information about files opened by processes. AIX has a virtual file system mounted at /proc that provides information about running processes, including the files opened by those processes. In such cases it is useful to obtain as much information as possible about the files that have been opened by a process to help pinpoint the cause of the problem. A process might have a defect that causes it to continuously create files without closing them, or it might open files, read and write to those files, but fail to close the files afterwards. A system administrator might find it necessary to obtain information about all files that are currently opened by a process.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |