![]() You can list the files opened by process names starting with a string, using ‘-c’ option. List opened files based on process names starting with If you don’t want lsof to recurse, then use ‘+d’ option. +D will recurse the sub directories also. You can list the processes which opened files under a specified directory using ‘+D’ option. You can list only the processes which opened a specific file, by providing the filename as arguments. List processes which opened a specific file Some of the values of TYPEs are,įor a complete list of FD & TYPE, refer man lsof. r for read, w for write, u for read and write. The character after the number i.e ‘1u’, represents the mode in which the file is opened. NUMBER – Represent the actual file descriptor.We will explain the details about couple of cryptic columns (FD and TYPE).įD – Represents the file descriptor. ![]() ![]() Most of the columns are self explanatory. Init 1 root txt REG 8,1 124704 917562 /sbin/initīy default One file per line is displayed. # lsofĬOMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME Simply typing lsof will provide a list of all open files belonging to all active processes. So by using lsof, you can get the information about any opened files. In unix, everything is a file, ( pipes, sockets, directories, devices, etc.). It is a command line utility which is used to list the information about the files that are opened by various processes. It is easy to remember lsof command if you think of it as “ls + of”, where ls stands for list, and of stands for open files.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |