非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`

相关文章:

  • 2021-08-04
  • 2021-11-29
  • 2021-07-15
  • 2022-02-07
  • 2021-08-22
  • 2022-03-01
猜你喜欢
  • 2022-01-06
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
  • 2022-12-23
  • 2021-09-26
  • 2021-05-26
相关资源
相似解决方案