發表文章

目前顯示的是 9月 12, 2021的文章

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