Rename – A Command Line Tool For Renaming Multiple Files in Linux

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

Ravi Saive

Simple Word a Computer Geek and Linux Guru who loves to share tricks and tips on Internet. Most Of My Servers runs on Open Source Platform called Linux.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Ubuntu Linux Toolbox: 1000+ Commands

You may also like...

37 Responses

  1. ramarasan.m says:

    Amazing tips. This is why Linux is Awesome.
    Thank you very much for your help :)

  2. Polar says:

    Backing up postfix mail files from mail server to WIN7 PC. The original mail files are named like this:,S

    Windows has an issue with the extention and files are copied with size 0, and recognizes them as .com executable. I discovered that it works fine when renaming the file to _com. I can even copy them over to a new mail server, and they are recognized by the new postfix server.

    My plan now is:

    cp /postfix/files/path/*,S /home/user/mail_backup/.

    next I tried this command, but nothing is happening, so I must be doing something wrong:

    rename -n ‘s/\.com:2,S$/\_com/’ *.com:2,S

    Please your advice.

    • Ravi Saive says:

      Give a try again with the help of following command with little modification.

      # rename -n 's/\.com/\_com/' *.com
  3. Prabhakar says:

    You just saved 4 hours of my time and made me to do the same job of 4 hours in just 2 minutes. :) Amazing tips. This is why Linux is Awesome.
    Thank you very much for your help :)

  4. WarboyIndia says:

    Great! I works in Ubuntu 14.04 LTS. Can you please explain the perl expressions also?
    I don’t get the pattern where and why to use “s/ $/” or “y/” etc. It’ll be helpful if you explain it a little.

  5. MD. Akter Hossain says:

    this command is not working on redhat linux………… why ?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Join Over 80000+ Linux Users
  1. 52882
  2. 2763
  3. 18,639

Enter your email to get latest Linux Howto's