Wednesday·24·November·2010
Multiple Move & Co. //at 00:08 //by abe
nion’s
blog made me notice that many people don’t know mmv
(multiple move), which approximately
works like this:
mmv '*.htm' #1.html mmv '*.foo.*' #1.#2.bla
Additionally, mmv
also can copy, link or
even append files when called as mcp
,
mln
or mad
respectively with the appropriate command line options.
When I told nion in IRC on #debian.de about mmv
, HE pointed me to the Perl
script /usr/bin/rename
, which is in Debian’s perl
package and therefore installed on nearly every Debian system by
default. It moves files by applying perl subsitutions to file names:
rename 's/\.htm$/.html/' *.htm rename 'y/A-Z/a-z/' *
Being curious, if the newly found tool is not only available in
Debian, I looked on a SuSE 9.0 box and indeed, I also found there a
/usr/bin/rename
. But — surprise,
surprise — it’s not a Perl script but an ELF binary. And although it
does similar things than mmv
and Debian’s
rename
, it is the simplest of the three
commands:
rename .htm .html *.htm rename foo foo00 foo? rename foo foo0 foo??
Note to my self: Nice add-on for your command line efficiency
talk.
Tagged as: Debian, Linux, nuggets, Open Source, Other Blogs, Shell, SuSE, UUUT
0 comments // show without comments // write a comment