Sort notes

From Noah.org
Jump to: navigation, search


Using GNU `sort` to sort IP addresses (long and sort form):

sort --numeric-sort --field-separator=. --key=1,1 --key=2,2 --key=3,3 --key=4,4
sort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4