How to view network ports being consumed

Source: Internet
Author: User
Tags memory usage port number

The following article mainly takes the 80 port number as an example, if you want to know the other port number can also use the method

1, how to view the 80 port occupancy under Windows? What process is used? How to terminate and so on.
The main use of the DOS tool under Windows, click "Start"-"Run", enter "cmd" and click the OK button to enter the DOS window, then run the following command:
>netstat-aon | findstr "
Proto Local address Foreign address state PID
= = ============ ============== ========== ======
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 1688
can see that port 80 is occupied by a program with process number 1688.
>tasklist | findstr "1688"
Image name PID session name Session # Memory Usage
========================= ====== ================ ======== ============
Inetinfo.exe 1688 Console 0 2,800 K
It is obvious that inetinfo occupies 80 ports; Inetinfo.exe is primarily used to support the debugging of Microsoft Windows IIS Network Services. This program is very important to the normal operation of your system.
Of course, not only the Inetinfo.exe process will take up 80 ports, this is only the case on my machine. If you don't know what this process is for, do not blindly kill it, preferably Baidu or Google search, of course, if you know it well, and determine that it can be terminated, then proceed to the following command.
>taskkill/pid 1688/f
succeeded: The process with PID 1688 has been terminated.
If you are familiar with this process and are sure that it can be terminated, then use the command above to terminate the process with PID 1688 directly. (This step can also be done in Task Manager, Inetinfo.exe is the image name in the Task Manager, select it, click "End Process")
>tasklist | findstr "1688"
confirms the successful termination and should return NULL if the execution of this command is successfully terminated.

2. How to view 80 port occupancy under Linux? What process is used? How to terminate and so on

Query port is occupied, which process is occupied in two ways: 1, netstat-anl | grep "80"; 2, lsof-i:80

How to terminate a process: Kill PID

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.