1.查看端口占用
#lsof -i:80
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
nginx 3103 root 11u IPv4 23249 0t0 TCP *:http (LISTEN)
nginx 3103 root 12u IPv6 23250 0t0 TCP *:http (LISTEN)
nginx 3163 nginx 11u IPv4 23249 0t0 TCP *:http (LISTEN)
nginx 3163 nginx 12u IPv6 23250 0t0 TCP *:http (LISTEN)
2.查看进程PID对应文件占用
cd /proc/$PID/fd
ls -l
网友评论