Rename all files in a directory with sequential numbers
Rename all files in a directory with sequential numbers
find . -name '*.jpg' | # find jpegs
awk 'BEGIN{ a=1 }{ printf "mv \"%s\" %02d.jpg\n", $0, a++ }' | # build mv command
bash # run that command
Written by Victor Kristof
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Related Tags
#bash
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#