[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sort's --key argument
From: |
Peng Yu |
Subject: |
sort's --key argument |
Date: |
Mon, 27 Jun 2011 12:10:39 -0500 |
Hi,
I want to sort by the 2nd column (see the 2nd command). But it seems
that it still sorts by the second column then by the first column.
Does anybody know how --key works?
$ cat input.txt
u a
c c
a a
e e
p a
m e
a a
l e
a a
$sort --key=2,2 input.txt
a a
a a
a a
p a
u a
c c
e e
l e
m e
$sort --key=2,2 --key=1,1 input.txt
a a
a a
a a
p a
u a
c c
e e
l e
m e
$ sort --version
sort (GNU coreutils) 7.4
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
--
Regards,
Peng
- sort's --key argument,
Peng Yu <=