(注:不是root用户的话,使用sudo命令查看,否则可能出现用户不显示问题)
一.用lsof命令(如果没有,请用yum install安装)
# lsof -i :8080 |grep "(LISTEN)"
java 25768 root 108u IPv6 1374286 0t0 TCP *:webcache (LISTEN)
二.用netstat命令:
[root@alpha-task-17-61 ~]# netstat -lnp|awk 'BEGIN{prt=":8080$"}{if ($4 ~ prt) print $0}'
tcp 0 0 :::8080 :::* LISTEN 25768/java
三.用ss命令:
[root@alpha-task-17-61 ~]# ss -lnp|grep 8080
LISTEN 0 50 :::8080 :::* users:(("java",25768,108))