Have you tried looking at "man mv", or even "man bash"?

On Sun, 29 Jul 2001 02:46, Randy Kramer wrote:
> Excuse me, but I want to jump in here with a third request -- how about
> a simple way to do:
>
> copy secret.* lies.*
>
> In other words, I have files like secret.txt, secret.txt,v, and
> secret.lock, and I want to rename them to lies.txt, lies.txt,v, and
> lies.lock.  I made a short script file to do this, and I think this
> could be adapted to what George wants to do, but I was hoping there was
> a simple one liner that I could keep in my head.
>
> My script, which I named mvwiki, saved in my /home/<me>/bin (which is on
> my path), and made executable:
>
> mvwiki
>
> #!/bin/bash
> # called with two parameters, in this case:  mvwiki secret lies
> mv $1.txt $2.txt
> mv $1.txt,v $2.txt,v
> mv $1.lock $2.lock
>
> I just wish I didn't have to write a script to do this, and modify it
> for simple variations, like additional or different extensions.
>
> Randy Kramer
>
> [EMAIL PROTECTED] wrote:
> > Hi!
> >
> > In, DOS, everyone knows that typing:
> >
> > copy *.txt *.doc
> >
> > Will make a copy of all .txt files but with a new extension, .doc
> >
> > Typing:
> >
> > copy secret*.txt lies*.txt
> >
> > Will make a copy of all .txt files starting with "secret" but with the
> > name "lies" instead of "secret".
> >
> > etc, etc, etc.
> >
> > The question is: How do you do this under Linux/bash?
> >
> > I understand that things like "cp secret*.txt lies*.txt" will not do it
> > because of the way bash expands
> > wildcard specifications (and can even have undesirable results if you
> > have a folder matching the
> > pattern lies*.txt, but that's another story :)).
> >
> > If DOS can do, I'm sure Linux can too!
> > Does anyone know how to do this?
> >
> > Thanks,
> > George

-- 
Sridhar Dhanapalan.
        "There are two major products that come from Berkeley:
        LSD and UNIX. We don't believe this to be a coincidence."
                -- Jeremy S. Anderson

Reply via email to