0

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?

mkhp70
  • 3
  • 2
  • 8 files - 30 secs per file - 4minutes work - Why post the question? – Ed Heal Apr 17 '16 at 15:36
  • Probably a duplicate of half of these search results for ["batch rename osx"](https://stackoverflow.com/search?q=batch+rename+osx) – jDo Apr 17 '16 at 15:37

2 Answers2

0

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

Gregory Pakosz
  • 69,011
  • 20
  • 139
  • 164
0

The premise of this question seems flawed because it assumes that one either has to use a single command or do everything manually when, in fact, there are other options. E.g. is a perl based script a single command? If you believe it is, then brew install rename and use that as suggested in this question. Otherwise, use the one-liner suggested by @Gregory Pakosz or check out these these search results.

jDo
  • 3,962
  • 1
  • 11
  • 30