user1354603 user1354603 - 1 year ago 97
iOS Question

Batch rename in OSX, add @2x to all files ending with .png

I would like to rename my images from .png to @2x.png. Is there some easy way to do this with the terminal?

Answer Source

With the help of Mark Setchell's answer I was able to solve this with the following one-liner:

for f in *.png; do NEW=${f%.png}@2x.png; mv ${f} "${NEW}"; done;

Edit: flopr was right, should work now

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download