题解 | netstat练习3-输出每个IP的连接数

#!/bin/bash

awk '{
    if($1=="tcp"){
        split($5,tmp,":")
        count[tmp[1]]++
    }
}
END{
    for (item in count){
        print item, count[item]
    }
}' nowcoder.txt | sort -k2 -nr

全部评论

相关推荐

理智的芭乐在查重:这边男朋友还有hc吗
点赞 评论 收藏
分享
10-13 16:58
门头沟学院 Java
面了100年面试不知...:一周七天,一天去一家上班😍😍😍
点赞 评论 收藏
分享
评论
1
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务