Last active
September 10, 2021 11:41
-
-
Save andrey-zakharov/3409673eb41706b7f89337c7fca1222b to your computer and use it in GitHub Desktop.
bash mass batch rename
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find -name OLDNAME\*png | |
| sed -E 's#.*STUFFTOREMOVE([0-9]+)(.*)\.png$#\0 newfancyname-\2/named_\1_art.webp#g' | |
| while read orig dest; do | |
convert $orig -write ~/some/destination/$dest; done | |
# convert png to webp | |
find -name \*png | while read p; do convert $p -write src/main/res/${p%.png}.webp; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment