To see which process is occupied by a port number under Windows

Source: Internet
Author: User

Collated from the network, for reference.

First, see which process the port number is occupied by Netstat-ano, but-O can only show the PID of the process

Take port number 1521 for example:

C:\Documents and Settings\administrator>netstat-ano | Find "1521"
  TCP    0.0.0.0:1521           0.0.0.0:0              listening       212
  tcp    10.0.5.215:1049        10.0.5.215:1521        established     276
  TCP    10.0.5.215:1050        10.0.5.215:1521        established     372
  TCP    10.0.5.215:1051        10.0.5.215:1521        established
  TCP    10.0.5.215:1052        10.0.5.215:1521        established     388
  TCP    10.0.5.215:1521        10.0.5.215:1049        established     212
  TCP    10.0.5.215:1521        10.0.5.215:1050        established     212
  TCP    10.0.5.215:1521        10.0.5.215:1051        established     212
  TCP    10.0.5.215:1521        10.0.5.215:1052        established     212

Then view the process details for 276, 372, 400, 388.

c:\documents and Settings\administrator>tasklist | findstr "212" Tnslsnr. EXE 212 Console 0 6,704 K C:\Documents and Settings\administrator>tasklist |                     findstr "276" Jqs.exe 1276 Console 0 1,812 K Oracle.exe 

276 console 0 156,192 k oscar.exe 5876 Console 0 105,276 k C:\Documents and Settings\administrator>tasklist | findstr "372" Oracle.exe 372 Console 0 118,856 K Java.exe 4 696 Console 0 91,372 K C:\Documents and Settings\administrator>tasklist |                     findstr "388" Msdtc.exe 660 Console 0 4,388 K Oracle.exe 388 Console 0 118,180 k alg.exe 3884 Console 0 2,948 k 


Also, you can use the above method to see which port numbers a process occupies.

Getting PID for a process

C:\Documents and Settings\administrator>netstat-ano | Find "276"
  TCP    0.0.0.0:1047           0.0.0.0:0              listening       276
  TCP    10.0.5.215:1049        10.0.5.215:1521        established     276
  TCP    127.0.0.1:5152         0.0.0.0:0              listening       1276

You can also use the Task Manager to select View-> Select Columns->pid options to view the PID of the program

View the port number that corresponds to the PID process usage

C:\Documents and Settings\administrator>netstat-ano | Find "276"
  TCP    0.0.0.0:1047           0.0.0.0:0              listening       276
  TCP    10.0.5.215:1049        10.0.5.215:1521        Established     276
  TCP    127.0.0.1:5152         0.0.0.0:0              listening       1276


Related Article

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.