LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 07-06-2019, 12:28 AM   #1
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Normandy, France
Distribution: Debian “testing” with very little “unstable”
Posts: 793
Blog Entries: 25

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
Why util-linux without rename?


Good morning.

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
 
Old 07-06-2019, 03:13 AM   #2
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 911

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Quote:
Originally Posted by Michael Uplawski View Post
is not included with the Debian version that I install from the “testing” repositories.

Do you know the reason?
As far as I know "rename" is a separate package in Debian (but I'm not running it myself).
Code:
in Ubuntu and Debian-derived distributions you install rename like this:

sudo apt-get install rename
Note too that there are two different implementations OF the rename command, the other one being a perl script with a differing syntax:
Code:
In Fedora and RedHat-derived distributions you install prename like this. Note the initial “p,” which stands for Perl.

sudo dnf install prename
You'll have to find out yourself if either the "rename" or the "prename" package is available in your testing distro.

This is the man page for the perl version of rename www.systutorials.com/docs/linux/man/1-prename/ and as you can see it's quite different from the util-linux one.
 
1 members found this post helpful.
Old 07-08-2019, 05:55 AM   #3
Michael Uplawski
Member
 
Registered: Dec 2015
Location: Normandy, France
Distribution: Debian “testing” with very little “unstable”
Posts: 793

Original Poster
Blog Entries: 25

Rep: Reputation: 495Reputation: 495Reputation: 495Reputation: 495Reputation: 495
TY for the information.

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.
 
Old 07-09-2019, 01:42 PM   #4
mrmazda
Senior Member
 
Registered: Aug 2016
Location: USA
Distribution: openSUSE, Debian, Knoppix, Mageia, Fedora, others
Posts: 1,709

Rep: Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528Reputation: 528
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.
 
Old 07-09-2019, 01:55 PM   #5
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,134

Rep: Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964
Quote:
Originally Posted by mrmazda View Post
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.
 
Old 07-09-2019, 02:12 PM   #6
freemedia2018
Member
 
Registered: Mar 2019
Distribution: various automated remasters
Posts: 152
Blog Entries: 2

Rep: Reputation: 103Reputation: 103
Quote:
The rename command is part of the util-linux package and is available from https://www.kernel.org/pub/linux/utils/util-linux/.
https://manpages.debian.org/testing/...e.ul.1.en.html

Quote:
June 2011
Quote:
Source last updated: 2019-01-10T08:30:43Z
I'm generally reluctant to file a bug report because they always prove to be a waste of my time. But if I were you I would still file one for this.
 
Old 07-09-2019, 05:24 PM   #7
ehartman
Member
 
Registered: Jul 2007
Location: Delft, The Netherlands
Distribution: Slackware
Posts: 911

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Quote:
Originally Posted by Timothy Miller View Post
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.
Code:
 $ file /usr/bin/rename
/usr/bin/rename: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, stripped
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).

Last edited by ehartman; 07-09-2019 at 05:27 PM.
 
Old 07-09-2019, 06:11 PM   #8
Timothy Miller
Moderator
 
Registered: Feb 2003
Location: Arizona, USA
Distribution: Debian, KDE Neon, Arch, Void
Posts: 3,134

Rep: Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964Reputation: 964
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.
 
1 members found this post helpful.
Old 07-09-2019, 08:32 PM   #9
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 5,958

Rep: Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380Reputation: 1380
Hi,
Quote:
Originally Posted by Timothy Miller View Post
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!

Evo2.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: GUI To Batch Rename Files On Linux With Exif And Music Tags Support: Inviska Rename LXer Syndicated Linux News 0 05-25-2019 12:07 PM
LXer: How to rename user in Linux (also rename group & home directory) LXer Syndicated Linux News 0 06-26-2018 12:54 PM
LXer: How to rename user in Linux (also rename group & home directory) LXer Syndicated Linux News 0 11-28-2017 07:53 PM
[SOLVED] Are the programs in util-linux the same version as those in util-linux-ng? harryhaller Slackware - Installation 2 10-07-2011 09:43 AM
Rename network interface (Rename ppp0 ...) Nicolas1390 Linux - Newbie 2 08-08-2011 02:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 03:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration