Linux command lsof use

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.