You are not logged in.

#1 2010-02-22 20:11:33

rangalo
Member
Registered: 2008-06-25
Posts: 108
Website

rename command !

Hi,

I come from debian background. I am used to rename the files in the following way on my debian system

rename 's/foo/bar/g'  *foo*

Now, on my ARCH system there is a rename command but if I try the above command it does nothing.

Are there 2 different versions of rename ?

Which one should I install if I want the mentioned functionality ?

thanks,

Offline

#2 2010-02-22 20:22:36

jimburnettva
Member
From: Virginia, USA
Registered: 2010-02-12
Posts: 48
Website

Re: rename command !

The debian/ubuntu version uses a perl replace method.....arch uses a different method.....

[jim@myhost etc]$ man rename

RENAME(1)                  Linux Programmer's Manual                 RENAME(1)

NAME
       rename - Rename files

SYNOPSIS
       rename from to file...

DESCRIPTION
       rename will rename the specified files by replacing the first occurrence of from in
       their name by to.

       For example, given the files foo1, ..., foo9, foo10, ..., foo278, the commands

              rename foo foo0 foo?
              rename foo foo0 foo??

       will turn them into foo001, ..., foo009, foo010, ..., foo278.

       And
              rename .htm .html *.htm

       will fix the extension of your html files.

SEE ALSO
       mmv(1), mv(1)

                                1 January 2000                       RENAME(1)
(END)


My Linux & Progamming Blog - Jimmy Burnett

Offline

#3 2010-02-22 20:26:54

wonder
Developer
From: Bucharest, Romania
Registered: 2006-07-05
Posts: 5,937
Website

Re: rename command !


Give what you have. To someone, it may be better than you dare to think.

Offline

Board footer

Powered by FluxBB