关于netstat常用选项

来源:4-1 netstat、ps与kill命令使用

Star3327752

2022-11-02 19:34:11

[root@localhost test]# netstat p

usage: netstat [-vWeenNcCF] [<Af>] -r         netstat {-V|--version|-h|--help}

       netstat [-vWnNcaeol] [<Socket> ...]

       netstat { [-vWeenNac] -I[<Iface>] | [-veenNac] -i | [-cnNe] -M | -s [-6tuw] } [delay]


        -r, --route              display routing table

        -I, --interfaces=<Iface> display interface table for <Iface>

        -i, --interfaces         display interface table

        -g, --groups             display multicast group memberships

        -s, --statistics         display networking statistics (like SNMP)

        -M, --masquerade         display masqueraded connections


        -v, --verbose            be verbose

        -W, --wide               don't truncate IP addresses

        -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

        -p, --programs           display PID/Program name for sockets

        -o, --timers             display timers

        -c, --continuous         continuous listing


        -l, --listening          display listening server sockets

        -a, --all                display all sockets (default: connected)

        -F, --fib                display Forwarding Information Base (default)

        -C, --cache              display routing cache instead of FIB

        -Z, --context            display SELinux security context for sockets


  <Socket>={-t|--tcp} {-u|--udp} {-U|--udplite} {-S|--sctp} {-w|--raw}

           {-x|--unix} --ax25 --ipx --netrom

  <AF>=Use '-6|-4' or '-A <af>' or '--<af>'; default: inet

  List of possible address families (which support routing):

    inet (DARPA Internet) inet6 (IPv6) ax25 (AMPR AX.25) 

    netrom (AMPR NET/ROM) ipx (Novell IPX) ddp (Appletalk DDP) 

    x25 (CCITT X.25) 

https://img.mukewang.com/climg/6362558609656f2925601600.jpg

为啥这里的常用选项不可以单个使用嘞?

比如

netstat -p

写回答

1回答

好帮手慕小尤

2022-11-03

同学你好,是可以单独使用的,同学在书写命令时少书写了一个-。则建议同学添加上,如下所示:然后重新测试试一下。

https://img.mukewang.com/climg/6363209f097fc11a03710047.jpg

祝学习愉快!

0

0 学习 · 9886 问题

查看课程