Yajo
Yajo

Reputation: 6418

How to use Bash rename to prepend a hyphen?

I want some files that end with .png to end with -sm.png.

I tried with rename .png -sm.png *.png but it failed with invalid option -- 'm'.

How can I do it?

Upvotes: 2

Views: 65

Answers (1)

Kalanidhi
Kalanidhi

Reputation: 5092

Try this method

rename 's/.png/-sm.png/' *

Upvotes: 3

Related Questions