//使用ss命令
[root@mdw ~]# ss -lptn 'sport = :5432'
State Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0 128 *:5432 *:* users:(("postgres",pid=6443,fd=3))
LISTEN 0 128 :::5432 :::* users:(("postgres",pid=6443,fd=4))
//使用netstat命令
[root@mdw ~]# netstat -nlp | grep :5432
tcp 0 0 0.0.0.0:5432 0.0.0.0:* LISTEN 6443/postgres
tcp6 0 0 :::5432 :::* LISTEN 6443/postgres
//使用lsof命令
[root@mdw ~]# lsof -n -i :5432 | grep LISTEN
postgres 6443 gpadmin 3u IPv4 7899526 0t0 TCP *:postgres (LISTEN)
postgres 6443 gpadmin 4u IPv6 7899527 0t0 TCP *:postgres (LISTEN)
Linux系统下如何查看某端口被某进程所占用
最新推荐文章于 2024-10-04 19:58:58 发布
本文展示了如何使用ss、netstat和lsof命令检查Linux系统中5432端口的状态,该端口通常被PostgreSQL数据库使用。通过这些命令,我们可以查看端口的监听状态以及与之关联的进程。
2792

被折叠的 条评论
为什么被折叠?



