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 Answers1

2

You want to use rename for this.

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