非root用户下执行
netstat -apn | grep 9990 | wc -l
结果为
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
0
为了单独获取最后一个数字,可以
port_count=`netstat -apn 2> /dev/null |grep 9990 |wc -l`
非root用户下执行
netstat -apn | grep 9990 | wc -l
结果为
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all.)
0
为了单独获取最后一个数字,可以
port_count=`netstat -apn 2> /dev/null |grep 9990 |wc -l`