Sort IPs

I was doing some research on spam again and had to do some stuff with a couple of IP Addresses. That’s where “sort” came in handy as a tool to do what its name suggests.

sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4 somefile.txt

This snippet only works if the text file got the IPs writtin in the first column.


Leave a Reply

Your email address will not be published. Required fields are marked *