Renaming hundreds of files at once for proper sorting

Posted by Mew on Ask Ubuntu See other posts from Ask Ubuntu or by Mew
Published on 2014-05-28T03:55:38Z Indexed on 2014/05/28 4:01 UTC
Read the original article Hit count: 216

Filed under:

I have a ton of files, all named stuff like 1.jpg, 2.jpg, 3.jpg, and so on up to 1439.jpg.

However, I have a problem with one of my projects and alphabetizing. It will usually go in the order 1.jpg, 10.jpg, 11.jpg and so on.

What I need is some way (or a script) to name the files so they are in the format such as 00001.jpg all the way up to 01439.jpg.

How would I be able to do this quickly and efficiently?

© Ask Ubuntu or respective owner

Related posts about batch-rename