Answer the question
In order to leave comments, you need to log in
Bash - how to sort files by numbers?
It would seem that there could be something complicated? cat *.tar* | tar xzf -
But when there are more than 99 files,
after 10 there will be not 11 but 100.
But then everything becomes sad.
And so the question
is the easiest way to sort files according to the sequence we need,
where after
1 there will be not
10
but 11
Example:
domain.ru_20170412_060001_full_445c63bf.tar
domain.ru_20170412_060001_full_445c63bf.tar.1
domain.ru_20170412_060001_full_445c63bf.tar.10
domain.ru_20170412_060001_full_445c63bf.tar.100
domain.ru_20170412_060001_full_445c63bf.tar.101
domain.ru_20170412_060001_full_445c63bf.tar.102
domain.ru_20170412_060001_full_445c63bf.tar.103
domain.ru_20170412_060001_full_445c63bf.tar.104
domain.ru_20170412_060001_full_445c63bf.tar.105
domain.ru_20170412_060001_full_445c63bf.tar.106
domain.ru_20170412_060001_full_445c63bf.tar.107
domain.ru_20170412_060001_full_445c63bf.tar.108
domain.ru_20170412_060001_full_445c63bf.tar.109
domain.ru_20170412_060001_full_445c63bf.tar.11
domain.ru_20170412_060001_full_445c63bf.tar.110
domain.ru_20170412_060001_full_445c63bf.tar.111
domain.ru_20170412_060001_full_445c63bf.tar.112
domain.ru_20170412_060001_full_445c63bf.tar.113
domain.ru_20170412_060001_full_445c63bf.tar.114
domain.ru_20170412_060001_full_445c63bf.tar.115
domain.ru_20170412_060001_full_445c63bf.tar.116
domain.ru_20170412_060001_full_445c63bf.tar.117
domain.ru_20170412_060001_full_445c63bf.tar.118
domain.ru_20170412_060001_full_445c63bf.tar.119
domain.ru_20170412_060001_full_445c63bf.tar.12
domain.ru_20170412_060001_full_445c63bf.tar.120
domain.ru_20170412_060001_full_445c63bf.tar.121
domain.ru_20170412_060001_full_445c63bf.tar.122
domain.ru_20170412_060001_full_445c63bf.tar.123
domain.ru_20170412_060001_full_445c63bf.tar.124
domain.ru_20170412_060001_full_445c63bf.tar.125
domain.ru_20170412_060001_full_445c63bf.tar.126
domain.ru_20170412_060001_full_445c63bf.tar.127
domain.ru_20170412_060001_full_445c63bf.tar.128
domain.ru_20170412_060001_full_445c63bf.tar.129
domain.ru_20170412_060001_full_445c63bf.tar.13
Answer the question
In order to leave comments, you need to log in
In the comment I went in the right direction, only I filed the wrong arguments.ls | sort -n -t '.' -k 4
in your case you can:
cat ./domain.ru_20170412_060001_full_445c63bf.tar.{1..100}
nope
domain.ru_20170412_060001_full_445c63bf.tar.1
domain.ru_20170412_060001_full_445c63bf.tar.10
domain.ru_20170412_060001_full_445c63bf.tar.100
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question