I tries a lot of whys to solve the following problem without a solution :(
I have a folder which contains files with the following name pattern:
number_name.txt
for example:
0_test.txt
17_test.txt
39_test.txt
99_test.txt
101_test.txt
17_test.txt
I need to get the file name which contain the max prefix number.
(when I compare the strings, I'm getting that "99_test.txt" is the highest which is not true....)
Thanks
Using version sort:
find -name '*.txt' | sort -V | tail -1
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