Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 29 Aug 1998 21:05:05 -0500
From:      Dan Nelson <>
To:        Patrick Seal <>, FBSDQ <freebsd-questions@FreeBSD.ORG>
Subject:   Re: Renaming multiple files
Message-ID:  <>
In-Reply-To: <000001bdd3b3$db1d9e40$>; from "Patrick Seal" on Sat Aug 29 21:16:46 GMT 1998
References:  <000001bdd3b3$db1d9e40$>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
In the last episode (Aug 29), Patrick Seal said:
> Let's say I have two files in two different directories.
> /foo/
> /bar/
> I want to rename the extensions to:
> /foo/bar.bbb
> /bar/foo.bbb
> Can someone give point me to some sort of shell or perl script, or possibly
> just a command that can let me do this simultaneously?

For one-time replacements, I recommend ports/misc/mmv.  Lets you do
things like: mmv "*.aaa" "=1.bbb"

Or, if you're script-minded or want portability to systems without mmv:

for i in */*.aaa ; do
   mv $i ${}.bbb

should work.  If you want to recurse abitrary directory levles, replace
*/*.aaa with `find . -name "*.aaa"` .

	-Dan Nelson

To Unsubscribe: send mail to
with "unsubscribe freebsd-questions" in the body of the message

Want to link to this message? Use this URL: <>