如何检查 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-26 11:10:20
健身为什么要多练腿?...
Blog Post With Youtube Video 我的儿子随我姓,为啥婆家反应那么大?
2025-06-26 11:35:18
我的儿子随我姓,为啥婆家反应那么大?...
Blog Post With Youtube Video 为什么不用rust重写Nginx?
2025-06-26 11:20:20
为什么不用rust重写Nginx?...
Blog Post With Youtube Video 有没有什么路由器让你用过之后彻底惊艳了?
2025-06-26 11:40:19
有没有什么路由器让你用过之后彻底惊艳了?...

Leave Your Message