26

On my Debian system (well, my LMDE system, but close enough), I have at least 3 different rename programs:

  • /usr/local/bin/rename : This is a Perl script, written by Tom Christiansen. Oddly enough, I can't seem to find which package installed it:

    $ dpkg -S /usr/local/bin/rename 
    dpkg-query: no path found matching pattern /usr/local/bin/rename
    
  • /usr/bin/prename : another perl script, written by Robin Barker, this one is part of the perl package:

    $ dpkg -S /usr/bin/prename
    perl: /usr/bin/prename
    
  • /usr/bin/file-rename : yet another Perl script, no clear authorship information but both a Larry (presumably Wall) and a Robin (presumably Barker) are mentioned. This one is installed by the rename package and is also symlinked to /usr/bin/rename:

    $ dpkg -S /usr/bin/file-rename
    rename: /usr/bin/file-rename
    

I also have rename.ul from util-linux but let's ignore that one for now. What is the difference between these 3 Perl scripts? They all seem to have the same man page, man rename, man file-rename and man prename all give me the same page.

我在天马彩票平台输了三十万I could go through the scripts themselves and try to understand the differences but that is not trivial and I am hoping someone will know what features each has that the others don't. Bonus points for explaining why the Debian world needs three separate Perl rename scripts.

  • It's worse than that! RHEL ships a completely different binary as part of their util-linux-ng package. % file =rename /usr/bin/rename: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), ... – thrig Sep 12 '15 at 14:09
  • @thrig I converted your answer to a comment since it was not actually answering the question (what's the difference between these scripts and why are there so many perl versions). You're talking about the rename from util-linux which is rename.ul on Debian and rename on RedHat systems. I mention it in the penultimate paragraph of my question. – terdon Sep 12 '15 at 14:47
  • what does update-alternatives --display rename show for you? Wondering if it's part of a post-installed alternative. – Jeff Schaller Sep 12 '15 at 15:21
  • @JeffSchaller no, it comes from . Its author (tchrist) is active on SE and he explained it to me in chat. – terdon Sep 12 '15 at 15:22
  • 4
    Related. For the record, the rename script with my name on it you mention supports some to-me-useful options like rewriting symlink targets instead of pathnames proper, reading the filename list from pipes, and null-terminated pathnames in that list — plus the “normal” -v and -i options. It’s an old, old, old script without proper documentation outside its usage message, but it’s a standard workhorse for en-masse filename rewrites. It’s one of maybe two or three scripts that I always want with me no matter where I go. – tchrist Sep 12 '15 at 16:49
19

Not sure if this should be a comment, but it's only a partial answer -- .

我在天马彩票平台输了三十万has what seems to be the seeds of the mess. Specifically:

我在天马彩票平台输了三十万So to summarise: for many years the perl package has provided /usr/bin/rename, a standalone utility implemented in perl. The issue is we don't want to provide the utility from the perl package anymore because it's been added locally inside debian/ and is not being maintained. A maintained version is available as a separate package, libfile-rename-perl.

The libfile-rename-perl mentioned above is now replaced by rename:

$ apt-cache show rename | head
Package: rename
Version: 0.20-3
Installed-Size: 69
Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
Architecture: all
Replaces: libfile-rename-perl
Provides: libfile-rename-perl
Depends: perl
Conflicts: libfile-rename-perl
Description-en: Perl extension for renaming multiple files

So, Perl has its own rename which is not maintained by Debian and provides /usr/bin/prename. The Debian devs maintain a package (apparently formerly known as libfile-rename-perl) which is the package that provides /usr/bin/rename: a symlink to /etc/alternatives/rename which itself is a symlink to the /usr/bin/file-rename script.

Tom Christiansen's script is bundled with Perl's Unicode::Tussle module. You've probably installed it and that's what provided /usr/local/bin/rename.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our , and

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