mkhp70 mkhp70 - 7 months ago 20
Bash Question

rename all png files in multiple directory

I have multiple png files in multiple directory, I want to rename all of them to Info.png

for example:

Projects\p1\Screen-1298.png
Projects\s4\Screen-43.png
Projects\k21\Screen-456.png
Projects\p14\Screen-345.png

To
Projects\p1\Info.png
Projects\s4\Info.png
Projects\k21\Info.png
Projects\p14\Info.png


Is there a single command to do that instead of renaming each file individually?

Answer

You can go with find ~/Projects -type f -name '*.png' -execdir mv {} Info.png \;