Command Used to view port usage in Windows

Source: Internet
Author: User

Start -- run -- cmd enter the command prompt and enter netstat-Aon to view all connected PIDs. Then, find the corresponding PID in the task manager.ProgramIf no PID exists in the task manager, select "View"-"Select column" in the task manager"

Often, when we start an application, we find that the ports required by the system are occupied by other programs. How do we know who owns the ports we need, next we will introduce a very simple method and hope it will be useful to you.

If we need to determine who is using port 80

1. Windows Platform
Run the following command in the Windows command line window:
C: \> netstat-Aon | findstr "80"
TCP 127.0.0.1: 80 0.0.0.0: 0 listening 2448
As you can see, the port is occupied by a process with the process number 2448. Continue to execute the following command:
C: \> tasklist | findstr "2448"
Thread.exe 2016 console 0 16,064 K
Well, thread occupies your port and kill it.
If you cannot find the process in step 2, open the task manager, check which process is 2448, and then kill it. If you want to view other ports. Change 80.

 

 

You know that you can view the port process by using the lsof + P port in Linux.
Use this command to check that all open ports under Win are occupied by the System Program and the PID of the program.
I used the command to solve the port occupation problem during a test N years ago. I thought it would be a few minutes to recall it. Share with you. For the convenience of writing the no AB parameter to the memory parameter, check netstat /?

---- Here is the excerpt of some output results --
Netstat-noab

Active connections
PROTO local address foreign address State PID
TCP 0.0.0.0: 135 0.0.0.0: 0 listening 996
C: \ windows \ system32 \ ws2_32.dll
C: \ windows \ system32 \ rpcrt4.dll
C: \ windows \ system32 \ RPCSS. dll
C: \ windows \ system32 \ svchost.exe
C: \ windows \ system32 \ advapi32.dll
[Svchost.exe]
TCP 0.0.0.0: 445 0.0.0.0: 0 listening 4
[System]
TCP 0.0.0.0: 2967 0.0.0.0: 0 listening 1776
[Rtvscan.exe]
TCP 72.71.0.24: 139 0.0.0.0: 0 listening 4
[System]
TCP 127.0.0.1: 1049 0.0.0.0: 0 listening 232
[Alg.exe]
TCP 127.0.0.1: 1060 0.0.0.0: 0 listening 2104
[Ccapp.exe]

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.