I have a folder with several numeric subfolders:
.
├── 1
├── 2
├── 3
├── 4
└── 5_a
I would like to find the one with the highest value. In this example it would be folder 4.
The folders can also be numbered:
.
├── 1e-3
├── 2e-3
├── 3e-3
├── 4e-3
└── 5e-3_a
How can I achieve this? The code is to be used in a bash script for batch processing.
I have tried: find . -type d -regex '.*/[0-9][^/]*' |sort -rn -t '\0' |head -n 1 but the regex syntax will not filter out exclusive numerical folders.
Best Regards