实例1

  检测与influxd程序相关的几个端口号。

lwk@qwfys ~ $ sudo netstat -naptu | grep LISTEN | grep influxd
tcp6       0      0 :::8083                 :::*                    LISTEN      15668/influxd   
tcp6       0      0 :::8086                 :::*                    LISTEN      15668/influxd   
tcp6       0      0 :::8088                 :::*                    LISTEN      15668/influxd  

  检测当前哪些端号号打开着
#实例2

lwk@qwfys ~ $ sudo netstat -tupln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      1617/dnsmasq    
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      1477/mysqld     
tcp6       0      0 :::3000                 :::*                    LISTEN      13576/grafana-serve
udp        0      0 0.0.0.0:631             0.0.0.0:*                           1050/cups-browsed
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           2908/chrome     
udp        0      0 0.0.0.0:5353            0.0.0.0:*                           852/avahi-daemon: r
udp        0      0 0.0.0.0:46618           0.0.0.0:*                           852/avahi-daemon: r
udp        0      0 0.0.0.0:40932           0.0.0.0:*                           1617/dnsmasq    
udp        0      0 127.0.1.1:53            0.0.0.0:*                           1617/dnsmasq    
udp        0      0 0.0.0.0:68              0.0.0.0:*                           1597/dhclient   
udp        0      0 192.168.1.71:123        0.0.0.0:*                           2539/ntpd       
udp        0      0 127.0.0.1:123           0.0.0.0:*                           2539/ntpd       
udp        0      0 0.0.0.0:123             0.0.0.0:*                           2539/ntpd       
udp6       0      0 :::42801                :::*                                852/avahi-daemon: r
udp6       0      0 :::5353                 :::*                                2908/chrome     
udp6       0      0 :::5353                 :::*                                852/avahi-daemon: r
udp6       0      0 fe80::1450:2330:2f6:123 :::*                                2539/ntpd       
udp6       0      0 ::1:123                 :::*                                2539/ntpd       
udp6       0      0 :::123                  :::*                                2539/ntpd