Last Updated: February 25, 2016
·
522
· revskill

Mass rename file in Ubuntu

Suppose i had multiple files with pattern *_1.jpg, and i want to rename all to *.jpg, this command does the job:

rename --no-act 's/_1.jpg/.jpg/' *.jpg

2 Responses
Add your response

There is nothing specific about rename(1). It was created by Larry Wall ages ago and is a mere perl script under the hood: less $(which rename).

over 1 year ago ·

Thank you for specializing the tool. The tool is built in already into Ubuntu 12.04, we just use it for that purpose only.

over 1 year ago ·