Lsof (list open files) is a tool that lists open files for the current system. In a Linux environment, everything is in the form of files, with files that not only access regular data, but also access to network connectivity and hardware.
Lsof +d/usr/local Displays the files that are open by the process in the current directory
Lsof +d/usr/local Displays the files that are opened by the process in the current directory, including files in other directories
Lsof file shows the process of opening file
LSOF-C ABC show ABC process open file
Lsof-p 123 shows the file opened by a process with PID 123
Lsof-g GID shows the process of attribution to GID
Lsof-u root Displays the files that are opened by the user root process
Lsof-u ^root displays files that are not open by the user root process
Lsof-u 1000 Displays the files opened by the process of the user with UID 1000
Lsof-i Show All open ports
LSOF-I:80 Show all processes that open port 80
lsof-i [email protected]:5060 shows which processes use UDP to open 192.168.129.126 5060 port
lsof-i [email protected]:ftp-r shows which processes use TCP to open the 192.168.129.126 FTP service,-R keeps viewing
http://blog.csdn.net/guoguo1980/article/details/2324454
Linux command lsof use