Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Possible Duplicate:
List files sorted numericallyList files sorted numerically

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1

Possible Duplicate:
List files sorted numerically

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1

Possible Duplicate:
List files sorted numerically

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1
insert duplicate link
Source Link

Possible Duplicate:
List files sorted numerically

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1

Possible Duplicate:
List files sorted numerically

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1
Post Closed as "exact duplicate" by l0b0, Mikel, manatwork, jasonwryan, Michael Mrozek
added 17 characters in body; edited title
Source Link
Mat
  • 54.9k
  • 11
  • 164
  • 143

SORT PROBLEM numeric Numerically sorting files

How can I sort this (numberaccording to the number of last field).? I trytried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1

SORT PROBLEM numeric

How can I sort this (number of last field). I try with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1

Numerically sorting files

How can I sort this according to the number of last field? I tried with sort -t ' ' -k9,10n:

-rw-r--r-- 1 root   root    440 May 14 08:52 test.txt.6
-rw-r--r-- 1 root   root    470 May 14 08:52 test.txt.8
-rw-r--r-- 1 root   root   2.6K May 14 08:52 test.txt.14
-rw-r--r-- 1 root   root    449 May 14 08:52 test.txt.7
-rw-r--r-- 1 root   root    434 May 14 08:52 test.txt.13
-rw-r--r-- 1 root   root    554 May 14 08:52 test.txt.4
-rw-r--r-- 1 root   root    426 May 14 08:52 test.txt.12
-rw-r--r-- 1 root   root   1.6K May 14 08:52 test.txt.5
-rw-r--r-- 1 root   root   7.2K May 14 08:52 test.txt.11
-rw-r--r-- 1 root   root    444 May 14 08:52 test.txt.3
-rw-r--r-- 1 root   root    927 May 14 08:52 test.txt.9
-rw-r--r-- 1 root   root    681 May 14 08:52 test.txt.15
-rw-r--r-- 1 root   root    427 May 14 08:52 test.txt.2
-rw-r--r-- 1 root   root    458 May 14 08:52 test.txt.16
-rw-r--r-- 1 root   root   2.4K May 14 08:52 test.txt.10
-rw-r--r-- 1 root   root    423 May 14 08:52 test.txt.17
-rw-r--r-- 1 root   root    424 May 14 08:52 test.txt.1
added 73 characters in body; edited tags
Source Link
rozcietrzewiacz
  • 40.2k
  • 9
  • 98
  • 105
Loading
Source Link
Loading