Check which files are opened by the process, which ports are used by the process, and which process is using the ports ............

Source: Internet
Author: User

Main Command: lsof netstat

Netstat-anpt | grep PID

After knowing the process number, you can use this method to view which network ports are being used by the current process

Run the lsof command to view the files opened by the process.

Lsof-P 2012 // What files are opened by a process whose process number is 2012 (all files in Linux). Generally, a server such as JBoss can see that it has opened many files.

Lsof-C Apache // files opened by the process named Apache

View which process is using the port

Lsof-I: port 8080/8080 is occupied by which process

PS-Ef | grep 8080 // you can also see the process that occupies port 8080.

There are many options for commands. For more information, see Manual.

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.