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
Written by Truong Hoang Dung
Related protips
2 Responses
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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Perl
Authors
janosgyerik
25.16K
Jean-Remy Duboc
12.25K
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#