Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a batch rename task and I find the 'rename' command in Ubuntu and Fedora is different.

In Ubuntu, rename is written in Perl and has regexp support. Is there anyway to install it on Fedora?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

The Perl script (by Larry Wall, himself) is called and you can find it with Google fairly easily.

For example, here

You will then need to save it in suitable directory. Probably /usr/local/bin/ and make sure it's executable. In Ubuntu, I would type

sudo chmod +x /usr/local/bin/

But I don't know if you use sudo on Fedora.

share|improve this answer
As of Fedora 15, sudo is configured by default. Previous versions required manual configuration. –  Patches Jun 27 '11 at 22:11
Noted, thanks @Patches. –  pavium Jun 27 '11 at 22:18
The link no longer works. –  Barmar Jul 13 '14 at 2:29

You can install it using cpan, which is the perl repository similar to pip for python.

Here is a tutorial on using cpan.

If you try to run rename it it looks like this

rename --help
call: rename from to files...

To install the perl rename you can do the following. You might need to install a few dependencies, you can generally just push enter

cpan1> install File::Rename
CPAN: Storable loaded ok (v2.20)
Going to read '/root/.cpan/Metadata'
Database was generated on Wed, 30 Sep 2015 08:17:02 GMT
Running install for module 'File::Rename'
Running Build install
Installing /usr/local/share/man/man1/rename.1
Installing /usr/local/share/perl5/File/
Installing /usr/local/share/man/man3/File::Rename.3pm
Installing /usr/local/bin/rename
Writing /usr/local/lib64/perl5/auto/File/Rename/.packlist
./Build install -- OK

That is how you would install the rename from cpan.
Next is to get it working on your system. As you might have more then one rename installed.

which rename  

When you actually want this one.

/usr/local/bin/rename --help
    rename [ -h|-m|-V ] [ -v ] [ -n ] [ -f ] [ -e|-E *perlexpr*]*|*perlexpr*
    [ *files* ]

    -v, -verbose
            Verbose: print names of files successfully renamed.

    -n, -nono
            No action: print names of files to be renamed, but don't rename.

    -f, -force
            Over write: allow existing files to be over-written.

    -h, -help
            Help: print SYNOPSIS and OPTIONS.

    -m, -man
            Manual: print manual page.

    -V, -version
            Version: show version number.

    -e      Expression: code to act on files name.

            May be repeated to build up code (like "perl -e"). If no -e, the
            first argument is used as code.

    -E      Statement: code to act on files name, as -e but terminated by

I just put it into /usr/bin/ but with a slight different name to make sure I did not break any existing scripts / programs the depend on the old one.

ln -s /usr/local/bin/rename /usr/bin/
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.