DebianThis forum is for the discussion of Debian Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
The rename tool which is normally part of the util-linux-package is not included with the Debian version that I install from the “testing” repositories.
Do you know the reason?
Searching for information on Debian.org, the words util-linux and rename produce too much information and I cannot find anything there. Usually, this kind of modification for one distribution is motivated by security considerations. Curiously, the man-page to rename is installed alright with util-linux.
TIA.
Last edited by Michael Uplawski; 07-06-2019 at 12:29 AM.
Reason: too many words... WIP
The situation is a bit confusing to me, as I can install util-linux from sources and thus use the rename command as I had known it years ago.
Unfortunately, nothing indicates upon doing so that the new version of the “mount” tool will afterwards not correspond to the installed version of the shared library libmount which is not the latest in the Debian-repositories. This leads to a more or less broken system, as my partitions are not mounted after boot.
Having “repaired“ my mount-command, I can still use the rename-command from the compiled util-linux package. Now would I say, that this is a way to get things working..?
Coming back to this thread in a while, it might serve as a reminder, but I still am in doubt.
Does rename do something mv does not? I learned mv back around 1986 and didn't know about any rename command in *nix until this thread.
rename is actually a perl script (therefore being prename on some os's) that allows you to rename multiple files at a time in ways that mv doesn't (easily) allow.
rename is actually a perl script (therefore being prename on some os's) that allows you to rename multiple files at a time in ways that mv doesn't (easily) allow.
No, rename from the util-linux package is quite different from the perl one and is a compiled binary, i.e.
As I already mentioned in my previous post, it has a completely different syntax from the perl script
Code:
NAME
rename - rename files
SYNOPSIS
rename [options] expression replacement file...
DESCRIPTION
rename will rename the specified files by replacing the first occurrence of
expression in their name by replacement.
(part of manpage skipped)
AVAILABILITY
The rename command is part of the util-linux package and is available from
ftp://ftp.kernel.org/pub/linux/utils/util-linux/.
Which of either rename commands YOU got is dependant on your distribution (and some may even have both, with the perl one as prename).
There is no actual rename with util-linux on Debian. It's rename.ul that's included. rename is a perl script that is installed via the rename package.
And to just add a little more info regarding Debian, the perl rename is installed as /usr/bin/file-rename, the util-linux one is /usr/bin/rename.ul and (at least on my machine) /usr/bin/rename is a chain of symlinks to /usr/bin/file-rename as part of the "alternatives" system. Somewhat strangely, rename.ul is not included as an option in alternatives. I guess it could easily be added if desired. Eg
Code:
# update-alternatives --list rename
/usr/bin/file-rename
# update-alternatives --install /usr/bin/rename rename /usr/bin/rename.ul 50
update-alternatives --list rename
/usr/bin/file-rename
/usr/bin/rename.ul
# update-alternatives --config rename
There are 2 choices for the alternative rename (providing /usr/bin/rename).
Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/file-rename 70 auto mode
1 /usr/bin/file-rename 70 manual mode
2 /usr/bin/rename.ul 50 manual mode
Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/rename.ul to provide /usr/bin/rename (rename) in manual mode
# readlink -f $(which rename)
/usr/bin/rename.ul
And there you have it, util-linux rename just as you like it!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.