I have files such as
a bb ccc abc emrls
I would like to rename them so that, after sorting them (for example, lexicographically), each file gets the following name:
00001 00002 00003 etc
where the # of digits for the 0 padding is specified a priori, e.g. 6 in the case above (assuming that we know how many digits are needed).
Since the shell I am most comfortable with is
zsh, I'm interested in solutions that benefit from features on
zsh (maybe using
zmv?). I would also be interested in solutions that are compatible with Bash.