【发布时间】:2016-02-25 23:46:33
【问题描述】:
我有个问题,不知道你能不能帮帮我。我所要做的就是按 Hour 元素对这些格式进行排序。但该元素采用以下格式:
192.168.100.200 - unauthenticated 25/Sep/2015:18:52:18 -0500
192.168.100.200 - unauthenticated 29/Sep/2015:14:20:41 -0500
192.168.100.200 - unauthenticated 29/Sep/2015:14:43:16 -0500
192.168.100.200 - unauthenticated 29/Sep/2015:14:44:04 -0500
192.168.100.200 - unauthenticated 29/Sep/2015:15:30:50 -0500
192.168.100.200 - unauthenticated 30/Sep/2015:13:53:04 -0500
192.168.100.200 - unauthenticated 30/Sep/2015:14:07:48 -0500
我必须按字段14:07:48 排序,我已经读过我可以用这个排序:
sort -t':'
但真正的问题是我必须打印所有排序的行。
我希望你能帮助我。
问候
【问题讨论】:
-
那是 7 行吗?空行是真的吗?
-
查看侧边栏中的第一个“相关”问题stackoverflow.com/questions/357560/…,了解更多关于如何告诉
sort排序的信息。
标签: linux sorting unix awk solaris