有时启动应用时会发现端口已经被占用,或者是感觉有些端口自己没有使用却发现是打开的。这时我们希望知道是哪个应用/进程在使用该端口。
CentOS下可以用netstat或者lsof查看,Windows下也可以用netstat查看,不过参数会不同
Linux:
netstat -nap #会列出所有正在使用的端口及关联的进程/应用
lsof -i :portnumber #portnumber要用具体的端口号代替,可以直接列出该端口听使用进程/应用
Windows:
netstat -nao #会列出端口关联的的进程号,可以通过任务管理器查看是哪个任务
Warning: A non-numeric value encountered in /data/wwwroot/lxy.me/wp-content/themes/Ality/inc/functions/comment-template.php on line 16
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/wwwroot/lxy.me/wp-content/themes/Ality/functions.php on line 249
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in /data/wwwroot/lxy.me/wp-content/themes/Ality/functions.php on line 249