Here is a list of files:
some.string_100_with_numbers.in-it.txt some.string_101_with_numbers.in-it.txt some.string_102_with_numbers.in-it.txt some.string_23_with_numbers.in-it.txt some.string_24_with_numbers.in-it.txt some.string_25_with_numbers.in-it.txt
Now I would like to sort it numerically. Starting with *23* and ending with *102*.
I have tried -n
and -g
. -t
does not help in these messy strings.
Can I ignore leading strings to the number with an option or do I have to be clever and script?
Use ls -lv
From the man page:
-v natural sort of (version) numbers within text
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With