为什么带有-p标志的netstat在Mac终端中不起作用?

时间:2019-05-30 14:56:13

标签: macos terminal netstat

我在Mac终端中使用netstat,但发现使用-p的任何命令将不再起作用。例如:

johnsmith@jm-MacBook-Pro:~/smith$ netstat -ap | grep http
netstat: option requires an argument -- p
Usage:  netstat [-AaLlnW] [-f address_family | -p protocol]
    netstat [-gilns] [-f address_family]
    netstat -i | -I interface [-w wait] [-abdgRtS]
    netstat -s [-s] [-f address_family | -p protocol] [-w wait]
    netstat -i | -I interface -s [-f address_family | -p protocol]
    netstat -m [-m]
    netstat -r [-Aaln] [-f address_family]
    netstat -rs [-s]

和:

johnsmith@jm-MacBook-Pro:~/smith$ netstat -tp
netstat: illegal option -- -
Usage:  netstat [-AaLlnW] [-f address_family | -p protocol]
    netstat [-gilns] [-f address_family]
    netstat -i | -I interface [-w wait] [-abdgRtS]
    netstat -s [-s] [-f address_family | -p protocol] [-w wait]
    netstat -i | -I interface -s [-f address_family | -p protocol]
    netstat -m [-m]
    netstat -r [-Aaln] [-f address_family]
    netstat -rs [-s]

我该如何解决?

0 个答案:

没有答案