#!/bin/bash
#
#********************************************************************
#encoding -*-utf8-*-
#Author: zhangshang
#Date: 2017-11-25
#URL: http://blog.vservices.top/myblog
#Description: The test script
#Copyright (C): 2017 All rights reserved
#QQ Numbers: 765030447
#********************************************************************
echo -e "\033[31m**************************net_tcp_top_10*********************************\033[0m"
echo -e "IPADDR\t\tcount"
ss -nt | grep 'ESTAB' | awk '{print $5}' | cut -d: -f1 | grep "^[[:digit:]]\+.*" | sort | uniq -c | sort -rnk1 | awk '{print $2,"\t",$1}' | head
执行结果:
**************************net_tcp_top_10*********************************
IPADDR count
192.168.253.1 2
文档更新时间: 2018-12-12 20:52 作者:张尚