linux - script or command to change the starting index number of a set of sequentially numbered files -


i have set of files named img1.png , img2.png ,...img10.png,.. , on. want achieve renaming these files starting index increased 30 such files become img31.png, img32.png,.....img40.png,....and on. possible using "rename" command? or script required? in either case how do this?

related - work have first rename files img001.png, img002.png, ...img010.png , , on? how done, if required?

add 30 numbers in each filename

rename 's/(\d+)/$1+30/e' *png 

rename 3 digits long

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

see perldoc perlre http://perldoc.perl.org/perlre.html details of how works, rename perl program


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -