我的4000端口被占用,但是我想杀死占用它的进程。当我使用netstat -anp | grep 4000
时然而结果是:
$ netstat -anp | grep 4000
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
tcp 0 0 0.0.0.0:4000 0.0.0.0:* LISTEN -
当我使用lsof -i:4000
时,我什么也没得到,所以曾经拥有4000端口的进程死了,4000端口还没有释放?
如何解决?
最佳答案
就像通知所说的那样,当我在普通用户中运行 netstat
时,不会显示非拥有的进程信息
。因此,使用sudo netstat
,您将看到进程ID。
关于linux - 网络端口被占用,但没有进程使用它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41646418/