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

Views :
Update time : 2025-06-29 03:05:10

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 长期使用的大佬来说说,MacOS 真的比 Windows 稳定吗?
2025-06-25 00:55:11
长期使用的大佬来说说,MacOS 真的比 Windows 稳定吗?...
Blog Post With Youtube Video 为啥 php 还有这么多人在用啊?
2025-06-25 00:10:12
为啥 php 还有这么多人在用啊?...
Blog Post With Youtube Video rust中的pin是不是一个失败的设计?
2025-06-24 23:40:11
rust中的pin是不是一个失败的设计?...
Blog Post With Youtube Video 为什么 macOS 并不差,可市场总敌不过 Windows?
2025-06-24 23:30:12
为什么 macOS 并不差,可市场总敌不过 Windows?...

Leave Your Message