• 计算进程出现次数


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

  • 相关阅读:
    Android
    Android
    Android
    Android
    Android
    Android
    Android
    Android
    Android
    Android
  • 原文地址:https://www.cnblogs.com/linn/p/4978444.html
Copyright © 2020-2023  润新知