ipsort script sorts a STDIN of IP addresses to STDOUT. It sorts by the first octet, then by the second, the third and the fourth.
Usage: Takes Standard in or a file or list of files. So ipsort < file1 > < file2 > or cat < file > | ipsort
It's quite clever and looks for an IP address on each line, rejecting if it doesn't find one
-c or --commas Separate the list by space-separated commas, rather than one IP per line.
-u or --unique Uniquely sort the list as well, to avoid duplicate IPs.
-s or --string Use this string to separate the IPs. Eg. -s :
-m or --multiple Search for multiple IP addresses per line.
-h or --help Display this usage message.