sorting IP-Addresses

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
#1
I found an advice to easily sort IP-Addresses:
Code:
F:\Temp >type clip:
192.168.85.26
192.168.81.52
192.168.82.70
192.168.81.160
192.168.85.72
192.168.87.70
192.168.87.111
192.168.87.88
192.168.170.5
192.168.82.115
192.168.81.173
192.168.83.87
192.168.87.34
192.168.87.73
192.168.87.107
192.168.98.55
192.168.87.115
192.168.85.6
192.168.87.117
192.168.87.109
192.168.87.69
192.168.87.67
192.168.87.48
192.168.82.1

F:\Temp >type clip: | gnusort -n -t . -k 1,1 -k 2,2 -k 3,3 -k 4,4
192.168.81.52
192.168.81.160
192.168.81.173
192.168.82.1
192.168.82.70
192.168.82.115
192.168.83.87
192.168.85.6
192.168.85.26
192.168.85.72
192.168.87.34
192.168.87.48
192.168.87.67
192.168.87.69
192.168.87.70
192.168.87.73
192.168.87.88
192.168.87.107
192.168.87.109
192.168.87.111
192.168.87.115
192.168.87.117
192.168.98.55
192.168.170.5
HTH.