找出日期相同的 第一行 最后一行
cat 1.txt2011-10-25 8:41:202011-10-25 8:41:382011-10-25 18:10:092011-10-26 8:29:052011-10-26 18:07:272011-10-27 8:35:412011-10-27 18:51:182011-10-28 8:38:002011-10-28 18:08:012011-10-29 8:46:132011-10-29 18:08:002011-10-31 18:05:332011-11-1 8:33:162011-11-1 18:07:072011-11-2 8:29:462011-11-2 18:05:412011-11-3 8:29:172011-11-3 18:04:402011-11-4 8:34:292011-11-4 18:10:23
[root@c2-dsj-hadoop183 ~]# awk '!b[$1]++;{a[$1]=$2}END{for(i in a)print i,a[i]}' 1.txt|sort -k1,1 -k2,2n2011-10-25 8:41:202011-10-25 18:10:092011-10-26 8:29:052011-10-26 18:07:2720����,�ദ11-10-27 8:35:412011-10-27 18:51:182011-10-28 8:38:002011-10-28 18:08:012011-10-29 8:46:132011-10-29 18:08:002011-10-31 18:05:332011-10-31 18:05:332011-11-1 8:33:162011-11-1 18:07:072011-11-2 8:29:462011-11-2 18:05:412011-11-3 8:29:172011-11-3 18:04:402011-11-4 8:34:292011-11-4 18:10:23