View the native open port number, see if a port number is occupied, see which process is occupied by the occupied port number, and how to end the process

Source: Internet
Author: User

Use the accelerator key win+r to open the Run window. Enter CMD return to open a command prompt window


1: View the port that is open for this machine, that is, the number of ports that have been occupied.

Command:

Netstat-an


Partial results list:

Proto Local Address Foreign
TCP 0.0.0.0:135 0.0.0.0:0 Listening
TCP 0.0.0.0:3473 0.0.0.0:0 Listening
TCP 0.0.0.0:8009 0.0.0.0:0 Listening


The local addresss corresponds to this column, ":" is the open port number behind.


2: See if a port number is occupied

For example, to see if MySQL's default service port 3306 is already occupied

Command:

Netstat-ano|findstr "3306"

----If no results are returned, the port is not occupied.

----If the result returned is:

TCP 0.0.0.0:8080 0.0.0.0:0 Listening 1640

Indicates that port 8080 is already occupied. 1640 is the process number that occupies 8080 of this port number.



3: View process number corresponding to the process name

Task Manager:

If you do not have a PID (process ID) column, you can select the column in the Task Manager's menu Bar-View-selection column.

Command:

Tasklist|findstr "1640"

This is the name of the process to view the 1640 process number.

The result returned is:

Tomcat5.exe 1640Console 0 33,802 K

Tomcat5.exe is the name of the process that occupies the 1640 port number.


4: End Process

You can end it directly in Task Manager, and open Task Manager shortcut key: Ctrl+shift+esc

Command:

Tskill process Name/process number

such as: Tskill Tomcat5.exe

Tskill 1640



If the process cannot end, you can close its application directly. or by using other tools

such as: xuetr (this tool can be downloaded in a personal network).



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.