You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

lsof无法显示netstat -pln列出的PID的问题求助

lsof无法显示netstat -pln列出的PID的问题求助

大家好,我是这个社区的新人,最近碰到个头疼的问题,想请各位帮忙支支招。

我本来想用lsof -t命令定位某个端口对应的PID,然后杀掉进程,但试了lsof -t -i:port却完全查不到目标PID。可当我执行netstat -pln的时候,明明能清楚看到该端口的进程信息,具体输出如下:

deploy@debian-4gb-nbg1-2:~/apps/ssr/splitfire.ai$ netstat -pln
(Not all processes could be identified, non-owned process info
 will not be shown, you would have to be root to see it all.)
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:21              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:5432            0.0.0.0:*               LISTEN      -
tcp        0      0 0.0.0.0:3000            0.0.0.0:*               LISTEN      1648178/puma 5.6.1
tcp        0      0 0.0.0.0:3002            0.0.0.0:*               LISTEN      -

就拿端口3000举例,netstat显示它被PID为1648178的puma进程占用,但我输入lsof -t -i:3000后却没有任何输出,这到底是哪里出问题了?有没有办法解决这个情况,让我能正常用lsof查到对应的PID呢?

备注:内容来源于stack exchange,提问作者Seto

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.15 11:07:59