Use netstat and tasklist to view PC port usage

Source: Internet
Author: User

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?

1. Windows Platform
Run the following command in the Windows command line window:

E: \ oracle \ ora92 \ bin> netstat
-Ano | find ": 80"
TCP
172.18.2.56: 3311
172.18.40.3: 80
Established 3704
TCP
172.18.2.56: 3319
172.18.65.7: 80
Established 3704
TCP
172.18.2.56: 4641
172.18.40.3: 80
Established 3704
TCP
172.18.2.56: 4734
172.18.65.7: 80
Established 3704
TCP
172.18.2.56: 4847
172.18.40.3: 80
Established 3560
TCP
172.18.2.56: 4848
172.18.40.3: 80
Established
3560

A process with a PID of 3560 occupies port 80 and continues to execute the following command:
E: \ oracle \ ora92 \ bin> tasklist
| Find
"3560"
Firefox.exe
3560
Console
0 147,564
K

It can be found that it is a Firefox process, and the Occupied memory size can be seen.

Comparison of the netstat command parameters:
E: \ oracle \ ora92 \ bin> netstat
-A | find ": 8080"
TCP
Wan: 8080
0.0.0.0: 0
Listening

E: \ oracle \ ora92 \ bin> netstat-an | find ": 8080"

TCP
0.0.0.0: 8080
0.0.0.0: 0
Listening

E: \ oracle \ ora92> netstat-ano | find ": 8080"

TCP
0.0.0.0: 8080
0.0.0.0: 0
Listening 3796.

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.