View port usage on Windows and Linux

Sometimes when you use a certain port, you will find that the port is occupied, but you don't know which program is occupied. You can check the port usage through the following command.

 

Windows

1, netstat -aon|findstr "xxx" xxxx- is the port number

2, tasklist|findstr "yyyy" yyyy is the ID number of the process using the port

 

Linux

1, netstat -anp|grep "xxxx" xxxx- is the port number

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326837987&siteId=291194637