慢慢赚钱博客

7月 4 2019

使用sort把IP地址排序

[root@localhost shell]# cat ip.txt
192.168.2.3
10.4.1.3
172.3.4.5
10.64.31.3
7.3.4.6
123.23.58.29
192.16.17.13
11.23.93.153
10.14.1.3
[root@localhost shell]# sort -t "." -k1n,1 -k2n,2 -k3n,3 -k4n,4 ip.txt
7.3.4.6
10.4.1.3
10.14.1.3
10.64.31.3
11.23.93.153
123.23.58.29
172.3.4.5
192.16.17.13
192.168.2.3
---------------------
作者:ivnetware
来源:CSDN
原文:https://blog.csdn.net/ivnetware/article/details/54564101
版权声明:本文为博主原创文章,转载请附上博文链接!

Written by moneyslow.com

moneyslow.com真棒!