¿É¼Ç
-n, --numeric-sort
compare according to string numerical value
-t, --field-separator=SEP
use SEP instead of non-blank to blank transition
-k, --key=POS1[,POS2]
start a key at POS1, end it at POS2 (origin 1)
-n ¿É¼Ç¸¸À» »ç¿ëÇßÀ»¶§´Â...ÀÚ¸´¼ö¿¡ µû¸¥ Á¤·ÄÀÌ Àû¿ëµÇÁö ¾Ê´Â´Ù.
[root@mojily ~]# cat a |sort -n
58.237.81.86
59.1.83.178
112.171.211.176
112.71.211.176
115.86.233.33
117.53.248.34
118.217.30.100
118.42.46.209
119.71.79.165
121.157.183.162
121.168.221.8
121.200.120.189
122.34.36.23
125.180.166.145
175.199.89.198
180.227.86.26
180.68.72.69
183.100.235.160
183.197.51.16
183.97.51.16
218.147.123.153
218.157.167.131
218.236.115.201
219.248.64.41
221.164.25.141
¾Æ·¡¿Í°°ÀÌ Çʵ尪À» ÁÖ°í ÀÚ¸´¼ö Á¤·Ä
[root@mojily ~]# cat a |sort -n -t. -k 1,1 -k 2,2 -k 3,3 -k 4,4
58.237.81.86
59.1.83.178
112.71.211.176
112.171.211.176
115.86.233.33
117.53.248.34
118.42.46.209
118.217.30.100
119.71.79.165
121.157.183.162
121.168.221.8
121.200.120.189
122.34.36.23
125.180.166.145
175.199.89.198
180.68.72.69
180.227.86.26
183.97.51.16
183.100.235.160
183.197.51.16
218.147.123.153
218.157.167.131
218.236.115.201
219.248.64.41
221.164.25.141