I have a list of directories based on the results of running the \"find\" command in bash. As an example, the result of find are the files:
test/a/file
test/b/fi
try this. for reference, it firsts sorts on the second field second char. which only exists on the file, and has a r for reverse meaning it is first, after that it will sort on the first char of the second field. [-t is field deliminator, -k is key]
find test -name file |sort -t'/' -k2.2r -k2.1
do a info sort
for more info. there is a ton of different ways to use the -t and -k together to get different results.