Renaming multiple files in a folder to a numbered format from the terminal

This is just for my reference. I needed to rename a whole lot of png files in a folder from filename.png, some-other-filename.png to 0.png, 1.png etc. It took a little bit of experimenting and it lead me to:

count=0; for file in *; do mv $file $count.png; let count=$count+1; done;

Categories: Tips, Useful | Tags: , | Leave a comment

Leave a Reply

Required fields are marked *

*