linux netstat 使用,中文说明 迎客

# netstat --help
usage: netstat [-veenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}
       netstat [-vnNcaeol] [<Socket> ...]
       netstat { [-veenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s } [delay]

        -r, --route                display routing table
   显示路由信息
  
        -I, --interfaces=[<Iface>] display interface table for <Iface>
   显示指定网络设备接口信息,不指定同“-i”
  
        -i, --interfaces           display interface table
   显示全部网络设备接口信息
  
        -g, --groups               display multicast group memberships
   显示组播成员关系
  
        -s, --statistics           display networking statistics (like SNMP)
   网络统计信息,类似于SNMP(挺好用的)
  
        -M, --masquerade           display masqueraded connections
   显示伪装连接

        -v, --verbose              be verbose
   详细信息(没有-an好用)
  
        -n, --numeric              don't resolve names
   不解析名称  
        --numeric-hosts            don't resolve host names
   不解析主机名
        --numeric-ports            don't resolve port names
   不解析端口名
        --numeric-users            don't resolve user names
   不解析用户名
  
        -N, --symbolic             resolve hardware names
   解析设备名称,默认为开启
  
        -e, --extend               display other/more information
   显示扩展信息(增加了用户、I结点的显示)
  
        -p, --programs             display PID/Program name for sockets
   显示有哪些进程/程序在使用网络
  
        -c, --continuous           continuous listing
   持续刷屏显示(由于不停地刷来刷去,不如用watch来得好)

        -l, --listening            display listening server sockets
   查看服务监听的端口情况
  
        -a, --all, --listening     display all sockets (default: connected)
   查看SOCKET端口情况,包括各种网络状态,包括了-l
  
        -o, --timers               display timers
   查看socket的定时器情况,如netstat -nto可以快速(不要名称解析)查出tcp的定时器情况
   Proto Recv-Q Send-Q Local Address               Foreign Address             State       Timer
   tcp        0    140 192.168.177.128:23          192.168.177.88:4191         ESTABLISHED on (0.34/0/0)
   tcp        0      0 192.168.177.128:23          192.168.177.88:4460         ESTABLISHED keepalive (2912.01/0/0)

        -F, --fib                  display Forwarding Information Base (default)
   显示前导(路由)信息,默认使用。
  
        -C, --cache                display routing cache instead of FIB
   显示Cache中的前导(路由)信息,而不是实时去FIB中获取
  
        -T, --notrim               stop trimming long addresses
   给长地址进行TRIM操作(貌似没有效果哦。。。)
  
        -Z, --context              display SELinux security context for sockets
   要与SELINUX配合使用,没使用过。。

<Iface>: Name of interface to monitor/list.
网络设备接口名称

<Socket>={-t|--tcp} {-u|--udp} {-S|--sctp} {-w|--raw} {-x|--unix} --ax25 --ipx --netrom
TCP、UDP、SCTP、原始SOCKET

<AF>=Use '-A <af>' or '--<af>'; default: inet
以太网,默认

原文地址:https://www.cnblogs.com/pengxl/p/1887904.html