I have a folder with about 1,700 files. They are all named like 1.txt or 1497.txt, etc. I would like to rename all the files so that all the filena
1.txt
1497.txt
for a in *.txt; do b=$(printf %04d.txt ${a%.txt}) if [ $a != $b ]; then mv $a $b fi done