Create dirs and sub-dirs with all alphabet names

for x in {a..z} ; do mkdir -p $x/${x}{a..z} ; done

Bash will expand XXX{a..z} out to XXXa, XXXb, and so on. There’s no need for the inner loop you have.

After that:

$ ls
a b c d e f g h i j k l m n o p q r s t u v w x y z
$ ls m
ma mc me mg mi mk mm mo mq ms mu mw my
mb md mf mh mj ml mn mp mr mt mv mx mz

Advertisements