有时使用某个端口,就会发现端口被占用,但是又不知道是那个程序占用的,可以通过下面的命令查看端口使用情况。
Windows
1,netstat -aon|findstr "xxx" xxxx-就是端口号
2,tasklist|findstr "yyyy" yyyy就是使用该端口的进程的ID号
Linux
1, netstat -anp|grep “xxxx” xxxx-就是端口号
![](https://img.laitimes.com/img/9ZDMuAjOiMmIsIjOiQnIsIyRQpkL4Vnbpx0c39GZul2dfNXd0FGdz9Fdy9Gcfh2YyFWZz9CXwEjMxkDMwIzLcNXZnFWbJlnc05WRvwVZsN3c1J3LcRXZu9lbkN3Yfd2bsJ2Xw9CXzV2Zh1WavwFdl5mLuR2cj5yZvxmYtA3Lc9CX6MHc0RHaiojIsJye.jpg)
有时使用某个端口,就会发现端口被占用,但是又不知道是那个程序占用的,可以通过下面的命令查看端口使用情况。
Windows
1,netstat -aon|findstr "xxx" xxxx-就是端口号
2,tasklist|findstr "yyyy" yyyy就是使用该端口的进程的ID号
Linux
1, netstat -anp|grep “xxxx” xxxx-就是端口号