Note that the
sort -V
(regardless of the -V
) example fails if filenames include newlines. This is what I came up with: find . -print0 | sort -Vz | tr '\0' '\n'
which includes the dirname (here ./
) in each entry. There are probably other methods