LinuxMint(Ubuntu Ver) 查看进程端口号及运行的程序

ubuntu下如何查看程序占用端口号

# netstat -atunp | more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      1363/cupsd     
tcp        0      0 192.168.189.128:58887   91.189.88.45:80         ESTABLISHED 2121/http      
tcp6       0      0 ::1:631                 :::*                    LISTEN      1363/cupsd     
udp        0      0 0.0.0.0:68              0.0.0.0:*                           803/dhclient   
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           782/avahi-daemon:
 r
udp        0      0 0.0.0.0:51352           0.0.0.0:*                           782/avahi-daemon:
 r

如何根据端口号来查看进程号
# lsof -i:631
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
cupsd   1363 root    5u  IPv6   6338      0t0  TCP localhost:ipp (LISTEN)

cupsd   1363 root    6u  IPv4   6339      0t0  TCP localhost:ipp (LISTEN)



你可能感兴趣的:(LinuxMint(Ubuntu Ver) 查看进程端口号及运行的程序)