Powerful lsof command using Linux system

Source: Internet
Author: User
lsof Command Introduction:

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. So, Lsof is a powerful feature. The general root user can execute the lsof command, and the normal user will see the/usr/sbin/lsof command, but normal user execution displays "permission denied". It is therefore helpful to see this list through the Lsof tool for system monitoring and troubleshooting.

Usage: [-?ABHLNNOOPRSTUVV] [+|-c c] [+|-d s] [+d d] [+|-F[CGG]]
[-F [F]] [-G [S]] [-I [i]] [+|-l [L]] [+|-m] [-O [O]]
[-P S] [+|-r [T]] [-S [t]] [-t [T]] [U S] [+|-w] [-X [FL]] [--] [Names]
As you can see, Lsof has a really surprising number of options. You can use it to get information about the device on your system, and you can learn what the specified user is touching at the specified location, or even what file or network connection a process is using.
For me, lsof replaced the whole work of Netstat and PS. It can bring everything that those tools can bring, and much more than those tools. So, let's take a look at some of its basic capabilities:

Enter lsof at the terminal to display the file opened by the system, because lsof needs to access core memory and various files, so it must be run as root to fully perform its functions.

Powerful lsof command using Linux system

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.