How to see if the native port number is occupied and how to close the corresponding port number __java

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 Netstat-ano|findstr "3306" (note that there is a space before the double quotes)


As you can see, the input port number "3306" and "51016" do not return any values, indicating that these two ports are not occupied,

and the input port number "52475" Saw, there are 2 rows returned results, indicating that this port is occupied

3: View process number corresponding to the process name Tasklist|findstr "9400"


Note: This is not the port number, but the process number of the port number shown later

As you can see, when you enter process number 9400, the process name that corresponds to the process number is displayed, that is, the 360se.exe

4: End Process Tskill 360se.exe

Tskill process Name/process number

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

Small knowledge: Netstat command usage command format:

Netstat-a-e-n-o-s-an-a represents all active TCP connections and the TCP and UDP ports on which the computer listens.

-E Indicates the number of bytes sent and received by the Ethernet, the number of packets, and so on.

-N indicates that only the address and port number of all active TCP connections is displayed numerically.

-O indicates that the active TCP connection is displayed and includes the process ID (PID) for each connection.

-S indicates statistics for various connections, including port numbers, by protocol.

-an View all open ports


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.