• 查看指定端口的占用情况
➜  ~ lsof -i:8100
COMMAND   PID  USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
nginx    9622 nginx   10u  IPv4   1411667      0t0  TCP *:xprint-server (LISTEN)
nginx    9623 nginx   10u  IPv4   1411667      0t0  TCP *:xprint-server (LISTEN)
nginx    9624 nginx   10u  IPv4   1411667      0t0  TCP *:xprint-server (LISTEN)
  • 查看所有端口的占用情况
[root@localhost ~]# netstat -ntlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      894/sshd            
tcp6       0      0 :::80                   :::*                    LISTEN      2105/docker-proxy   
tcp6       0      0 :::22                   :::*                    LISTEN      894/sshd

标签: 端口

添加新评论