I am on Ubuntu 22, and I have a large tree of files with annoying names that include numeric values in a variety of positions. Something like:
./2
./2/9
./2/10
./2/8
./1
./1/2
./1/1
./1/11
./11
./11/page 6
./11/page 05
./11/page 4
I want to sort this according to the numeric values, ignoring anything like 'page', so that I get:
./1/1
./1/2
./1/11
./2/8
./2/9
./2/10
./11/page 4
./11/page 05
./11/page 6
I've tried sort -n but even if I look just at the first-level directory names that doesn't seem to do what I expect:
$ find . -mindepth 1 -type d | sort -n
./1
./11
./2
Is there a handy dandy option out there for "sort by each whole number (not digit)"?