Re: rename all directories in structure

From: Green, Simon (SGreen@KRAFTEUROPE.COM)
Date: Tue Oct 01 2002 - 11:33:49 EDT


Whether you can do it with a single command depends on how you want to
rename them, (and how you define "single command").

You could start with find:

find /OLDIR1 -type dir -exec ....

For the exec, if it's a simple enough change you may be able to code it
there; otherwise you might need to write a small script and invoke that,
possibly using a look-up table. The rename itself should simply be done
with the mv command.

Simon Green
Philip Morris ITSC Europe

AIX-L Archive at http://marc.theaimsgroup.com/?l=aix-l&r=1&w=2
AIX FAQ at http://www.faqs.org/faqs/aix-faq/

N.B. Unsolicited email from vendors will seldom be appreciated.

> -----Original Message-----
> From: John Dunn [mailto:john.dunn@SEFAS.CO.UK]
> Sent: 01 October 2002 14:04
> To: aix-l@Princeton.EDU
> Subject: rename all directories in structure
>
>
> How can I easily rename ALL the directories in a structure?
> Is this possible
> with a single command?
>
> I would want all ownerships and permissions on all
> directories and files to
> be retained.
>
> e.g. /OLDIR1/OLDDIR2/OLDDIR3
>
> becomes
>
> /NEWDIR1/NEWDIR2/NEWDIR3
>
> the OLDDIRs should no longer exist afterwards



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:14 EDT