Renaming files in linux at once

Problem description:

When you have hundreds of files in the folder, and you want to rename them with the same rule...

For example, I have images named img0.jpg, img1.jpg, img2.jpg......, and I expect them named img00000.jpg, img00001.jpg, img00002.jpg. 

Commands: 

$ rename 's/\d+/sprintf("%05d", $&)/e' *.jpg


Reference:

https://askubuntu.com/questions/473236/renaming-hundreds-of-files-at-once-for-proper-sorting

留言

這個網誌中的熱門文章

Tuing PID parameters in QGroundcontrol (2)

Useful PX4 Parameters

Burn linux image to eMMC storage on Banana Pi M3