1
在Linux操作系统(Ubuntu的),一个外壳实用程序将输出以下数据如何对制表符分隔出来?
23827492 name_1
3984989229 name 2
8238937 another name
所以有2场,号码和姓名。我需要的是在linux shell中通过asc或desc中的数字对输出进行排序。不使用python/perl最简单的方法是什么?
在Linux操作系统(Ubuntu的),一个外壳实用程序将输出以下数据如何对制表符分隔出来?
23827492 name_1
3984989229 name 2
8238937 another name
所以有2场,号码和姓名。我需要的是在linux shell中通过asc或desc中的数字对输出进行排序。不使用python/perl最简单的方法是什么?
试试这个:
sort -g <filename>
而且使用-r
反向排序
'排序这并做 '自然排序' -n'工程太为你的情况 – jman 2012-02-22 07:55:21
?即“100a”会在“20b”后面出现,还是会是“20b”,因为它开始于2? – mpen 2012-02-22 07:56:11
查看[manpage](http://manpages.ubuntu.com/manpages/lucid/en/man1/sort.1.html) – 2012-02-22 15:12:09