cat ./listofip | awk '{print $1}' |sort |uniq -c |sort -n |tail
10.0.2.31:3306 127.0.0.1:47666 10.0.2.31:3306 127.0.0.1:47662 127.0.0.1:47016 127.0.0.1:8009 127.0.0.1:47664 127.0.0.1:47710 10.0.2.31:3306 127.0.0.1:32000 127.0.0.1:8009 127.0.0.1:47642 10.0.2.31:3306 10.0.2.31:3306 127.0.0.1:47716 127.0.0.1:47644 127.0.0.1:47779 10.0.2.31:3306 127.0.0.1:49418 10.0.2.31:3306 127.0.0.1:47768 10.0.2.31:11999 10.0.2.31:3306 ::ffff:10.0.3.25:55746 ::ffff:10.0.3.28:51756 ::ffff:127.0.0.1:42719 ::ffff:10.0.2.19:52039 ::ffff:10.0.3.25:56089 ::ffff:10.0.4.26:45995 ::ffff:10.0.3.19:35024 ::ffff:10.0.2.27:35840 ::ffff:10.0.2.18:61617 ::ffff:52.0.22.114:55340 ::ffff:10.0.3.22:51753 ::ffff:127.0.0.1:3306
The output is:
1 ::ffff:10.0.3.22:51753 1 ::ffff:10.0.3.25:55746 1 ::ffff:10.0.3.25:56089 1 ::ffff:10.0.3.28:51756 1 ::ffff:10.0.4.26:45995 1 ::ffff:127.0.0.1:3306 1 ::ffff:127.0.0.1:42719 1 ::ffff:52.0.22.114:55340 2 127.0.0.1:8009 8 10.0.2.31:3306
However, I want to output all even if it is just a single instance. And I feel like I am missing why the IP6 are being removed or not counting correctly.
Any help appreciated!
[link] [comments]