This seems to be by design, so that when you list the files or use a wildcard to match all of them, they will be shown in the correct order. If the names were strictly sequential, suffix 99
would be followed by 100
, but filename.100
sorts between filename.10
and filename.11
(filenames are normally sorted lexicographically, not numerically).
So when it reaches the 90's, it adds more digits to the suffix, to ensure that the additional files will sort correctly if there are more than 10 more. I suppose it could have waited until 99
, and then continued with 9900
, 9901
, etc., but then when it reaches 9999
it will have to add digits again; by increasing at 90
it means it can then handle an additional 1000 files before having to grow.
As mentioned in the comments, you can use the -a
option to specify the suffix length instead of letting it choose the default (starting at 2 digits until it reaches 90
).
-a
(or--suffix-length
) option to pad the numeric suffixes to the same number of digits? That way the shell should sort them naturally. – steeldriver Sep 30 '17 at 22:07