Get the App
SLTechnology News&Howtos  ›  Servers  › 

Window uses cmd to view commands such as port occupancy, corresponding processes, killing processes, etc.

Shulou Source: shulou.com Published: 2022-06-02 21:42:14 10月02日 Update

How to view the port occupied by the program

First, view the ports occupied by all processes

At start-run-cmd, enter: netstat-ano to view all processes

Second, view the programs that occupy the designated port

When you publish a program with tomcat, you will often encounter the situation that the port is occupied. We want to know which program or process occupies the port. We can use this command netstat-ano | findstr "specify port number" 2. Check the programs that occupy the specified port. When you publish programs with tomcat, you will often encounter the situation that the port is occupied. We want to know which program or process occupies the port. You can use this command netstat-ano | findstr "specify port number" 2. View the programs that occupy the specified port

When you publish a program with tomcat, you will often encounter the situation that the port is occupied. We want to know which program or process occupies the port. You can use this command netstat-ano | findstr "specify port number".

For example, query the processes that occupy port 8080: netstat-ano | findstr "8080"

Third, kill related processes through the task manager

Method 1: use the task manager to kill the process

Open Task Manager-> View-> Select column-> then check the PID option. When you go back to Task Manager, you can view the corresponding pid, and then end the process.

Of course, the above method is sometimes not useful, that is, when there are many processes in the task manager, it is very troublesome to find the corresponding process, so there is another way to kill the process.

Method 2: use the command to kill the process

1 > first find the process name corresponding to the process number

Tasklist | findstr process number

Such as: tasklist | findstr 3112

2 > then kill the process according to the process name

Taskkill / f / t / im process name

For example, taskkill / f / t / im / javaw.exe

Tags: Process port program task management command method slogan name regular meeting situation bad that is time sometimes trouble query input run Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Tech Info Redmi Linux Apple