1. #!/bin/bash
  2. #
  3. #********************************************************************
  4. #encoding -*-utf8-*-
  5. #Author: zhangshang
  6. #Date: 2017-11-25
  7. #URL: http://blog.vservices.top/myblog
  8. #Description: The test script
  9. #Copyright (C): 2017 All rights reserved
  10. #QQ Numbers: 765030447
  11. #********************************************************************
  12. echo -e "\033[31m**************************net_tcp_top_10*********************************\033[0m"
  13. echo -e "IPADDR\t\tcount"
  14. ss -nt | grep 'ESTAB' | awk '{print $5}' | cut -d: -f1 | grep "^[[:digit:]]\+.*" | sort | uniq -c | sort -rnk1 | awk '{print $2,"\t",$1}' | head

执行结果:

  1. **************************net_tcp_top_10*********************************
  2. IPADDR count
  3. 192.168.253.1 2
文档更新时间: 2018-12-12 20:52   作者:张尚