比如有如下文件test.txt
1 134.102.173.43
2 134.102.173.43
3 134.102.171.42
4 134.102.170.9
要统计出现次数最多的IP可以利用以下shell脚本:
cat test.txt | awk '{print $2}' | sort | uniq -c | sort -n -r | head -n 1
2024-04-08 12:57:03
比如有如下文件test.txt
1 134.102.173.43
2 134.102.173.43
3 134.102.171.42
4 134.102.170.9
要统计出现次数最多的IP可以利用以下shell脚本:
cat test.txt | awk '{print $2}' | sort | uniq -c | sort -n -r | head -n 1