Sort ip address list

“hosts” = file containing hosts.

cat hosts | sort -n -t. -k 1,1 -k 2,2 -k 3,3 -k 4,4

This sorts all octets as well.

Advertisements