找出日期相同的 第一行 最后一行
cat 1.txt 2011-10-25 8:41:20 2011-10-25 8:41:38 2011-10-25 18:10:09 2011-10-26 8:29:05 2011-10-26 18:07:27 2011-10-27 8:35:41 2011-10-27 18:51:18 2011-10-28 8:38:00 2011-10-28 18:08:01 2011-10-29 8:46:13 2011-10-29 18:08:00 2011-10-31 18:05:33 2011-11-1 8:33:16 2011-11-1 18:07:07 2011-11-2 8:29:46 2011-11-2 18:05:41 2011-11-3 8:29:17 2011-11-3 18:04:40 2011-11-4 8:34:29 2011-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,2n 2011-10-25 8:41:20 2011-10-25 18:10:09 2011-10-26 8:29:05 2011-10-26 18:07:27 2011-10-27 8:35:41 2011-10-27 18:51:18 2011-10-28 8:38:00 2011-10-28 18:08:01 2011-10-29 8:46:13 2011-10-29 18:08:00 2011-10-31 18:05:33 2011-10-31 18:05:33 2011-11-1 8:33:16 2011-11-1 18:07:07 2011-11-2 8:29:46 2011-11-2 18:05:41 2011-11-3 8:29:17 2011-11-3 18:04:40 2011-11-4 8:34:29 2011-11-4 18:10:23