在N不是先验固定的情况下:
原文链接:https://www.f2er.com/bash/390056.htmlfor f in foo[0-9]*; do mv $f `printf foo%05d ${f#foo}`; done
for f in foo[0-9]*; do mv $f `printf foo%05d ${f#foo}`; done