Bug#706043: RFS: re-name/1.99.2-1 [ITP] -- mass rename tool using regular expression
Hi Stuart,
Thanks for your reply. I will explain my choise. There are some
differences between rename and re-name.
Firstly, re-name is C compiled and it adds performance. I used re-name
in the last year to rename about ~300 milions of files on four
servers. It was made several times. I tested others programs before to
use re-name. A little comparative test (Intel Core i5-2400 CPU @
3.10GHz / 8 GB RAM):
# cd /tmp/1
# for i in $(seq 1 200000); do touch $i; done
# cd /tmp; cp -a 1 2
On /tmp/1 (prename):
time rename 's/2/C/' *
real 0m24.278s
user 0m3.596s
sys 0m1.308s
# time rename 's/3/d/' *
real 0m22.813s
user 0m3.488s
sys 0m1.380s
# time rename 's/4/e/' *
real 0m23.547s
user 0m3.640s
sys 0m1.364s
On /tmp/2 (re-name):
# time re-name -s'/2/C/' *
81903 files renamed.
real 0m17.733s
user 0m0.668s
sys 0m1.448s
# time re-name -s'/3/d/' *
81902 files renamed.
real 0m16.504s
user 0m0.624s
sys 0m1.418s
# time re-name -s'/4/e/' *
81902 files renamed.
real 0m17.238s
user 0m0.596s
sys 0m1.500s
The re-name was 27% faster than rename. In milions of files, it makes
a difference. re-name has others features not available in rename.
re-name can be recursive and read filenames from a file too. I used
recursively in my case. The options are (extracted from manpage):
-l, --lowercase
Lowercase specified filenames.
-u, --uppercase
Uppercase specified filenames.
-R, --recursive
Perform on the specified files and all subdirectories.
-t, --test
Test only mode. It won't change anything, just test the
result of searching and substituting.
-f, --file
Load file names from the specified files.
-o, --owner OWNER
Change the ownership of the specified files to OWNER.
(superuser only)
-v, --verbose
verbose display.
-A, --always
Always overwrite the existed files
-N, --never
Never overwrite the existed files, discard the renaming
process instead
Thanks a lot again.
Best regards,
Eriberto
2013/4/23 Stuart Prescott <stuart@debian.org>:
> Perhaps you could compare it to the tool prename(1) (which is usually also
> /usr/bin/rename on Debian systems) and is part of the perl package hence
> widely installed. It's important for potential sponsors and reviewers to
> understand what each new package brings to Debian compared to the ones that
> are already available.
Reply to: