如何检查 Linux 服务器中正在侦听哪些端口?

Views :
Update time : 2025-06-28 19:05:15

linux 一行命令 查询所有 python进程 命令行及 所监听端口 =sudo ps -eo pid,args | grep '[p]ython' | while read pid cmd; do ports=$(sudo ss -ltnp 2>/dev/null | grep "pid=$pid," | awk '{print $4}'); if [ -n "$ports" ]; then echo "PID: $pid, CMD: $cmd"; echo " $ports"; fi; done 上面还清楚一点 root@10-40-47-90:~# sudo sh -c ' ss_output=$(ss -ltnpu); ps -eo pid,args | awk "/[p]ython/ {print \$1}" | whil…。

如何检查 Linux 服务器中正在侦听哪些端口?
Related News
Read More >>
Blog Post With Youtube Video 有一双超级大长腿是什么感觉?
2025-06-25 06:20:15
有一双超级大长腿是什么感觉?...
Blog Post With Youtube Video 现在的市场对 C++ 的需求大吗?
2025-06-25 06:25:15
现在的市场对 C++ 的需求大吗?...
Blog Post With Youtube Video 字节大量使用新语言,包括go,rust等,为什么阿里一直都抱着j***a不松手?
2025-06-25 07:50:16
字节大量使用新语言,包括go,rust等,为什么阿里一直都抱着j***a不松手?...
Blog Post With Youtube Video 有个漂亮女朋友是种怎样的体验?
2025-06-25 06:25:15
有个漂亮女朋友是种怎样的体验?...

Leave Your Message