1

I have about 130 images in the following syntax:

image100.jpeg
image101.jpeg
....
image1.jpeg
image20.jpeg
image21.jpeg
..
image2.jpeg

and so on. I want rename with the following syntax because I want conver them into pdf.

image001.jpeg
image002.jpeg
...
image020.jpeg
image021.jpeg
...
image100.jpeg

how could I do it in bash ?

Lews
  • 342
  • 1
  • 7
  • 1
    Does this answer your question? [Renaming hundreds of files at once for proper sorting](https://askubuntu.com/questions/473236/renaming-hundreds-of-files-at-once-for-proper-sorting) –  Nov 29 '21 at 16:25

1 Answers1

2

You want to use rename for this.

rename 's/\d+/sprintf("%03d",$&)/e' image*