Bulk renaming files with the rename command


Once you understand its syntax and use, the rename command is an efficient and very powerful utility for virtually any bulk renaming job you have in mind – from converting file names to title case, to moving files into different directories, to changing month numbers into month names (e.g., 2015-02-17 into 2015-Feb-17). All of these jobs and more can be performed with rename. Furthermore, several jobs can be combined into one command for even more power and flexibility.

This article has covered a number of examples to showcase the major features of rename, but I have only scratched the surface in terms of what can be done with the command. Hopefully, you will be inspired to come up with your own rename commands.

The Author

Michael Williams, better known by his pseudonym Gordon Squash, is a freelance, open source software developer. He is a member of the Core Developers Team of the MATE Desktop Environment project (https://mate-desktop.org/), enjoys hacking anything related to the GTK+ GUI widget toolkit, and works toward developing a fork of GTK+ called STLWRT (https://github.com/thesquash/stlwrt) when time permits. You can see some of his other current projects on his personal GitHub page (https://github.com/thesquash/).

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Bulk Renaming

    When it comes to renaming multiple files, the command line offers time-saving options in the form of mv, rename, and mmv.

  • Programming Snapshot – Bulk Renaming

    Renaming multiple files following a pattern often requires small shell scripts. Mike Schilli looks to simplify this task with a Go program.

  • Bulk Renamers
  • Command Line: Grep

    Once you understand the intricacies of grep, you can find just about anything.

  • Admin Workshop: Finding Files

    Modern computers with their multiple Gigabyte hard disks store thousands of files. A lost file can cause a lot of work,and it can also pose a security risk. Fortunately,Linux has some versatile tools for finding those “lost files.”

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More