travelright.blogg.se

Linux list all processes by port
Linux list all processes by port












linux list all processes by port

Update-no 1892 lakshmanan 21w FIFO 0,6 pipeīash 1995 lakshmanan cwd DIR 8,1 4096 393218 /home/lakshmanan Update-no 1892 lakshmanan 20r FIFO 0,6 pipe In order to find the list of files opened by a specific users, use ‘-u’ option. By using lsof we can find those processes. So we need to find out what are all the processes using the mount point and kill those processes to umount the directory. Sometime when we try to umount a directory, the system will say “Device or Resource Busy” error. Ssh-agent 1528 lakshmanan 2u CHR 1, /dev/null Ssh-agent 1528 lakshmanan 1u CHR 1, /dev/null You can give multiple -c switch on a single command line. c followed by the process name will list the files opened by the process starting with that processes name. 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.

linux list all processes by port

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.














Linux list all processes by port