Edgaras Karka
Edgaras Karka

Reputation: 7852

Linux rename command pattern

I have folder with 400 images. And all titles is something like modarticle_52a23d7220e63_logo-min.jpg my goal is using linux command rename rename all files removing part -min from titles. What pattern I should use?

Upvotes: 0

Views: 236

Answers (2)

steffen
steffen

Reputation: 16948

With rename:

rename s/-min// *

Upvotes: 1

jofel
jofel

Reputation: 3405

Use

rename -- "-min" "" *.jpg

You need --, otherwise rename would think -m is an unknown option and fail.

Upvotes: 0

Related Questions