Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.unix.wizards Subject: Re: REQUEST HELP --- Merging Similar Directories. Message-ID: <7559@chinet.chi.il.us> Date: 28 Jan 89 05:19:40 GMT References: <1721@ektools.UUCP> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Distribution: usa Organization: Chinet - Public Access Unix Lines: 19 In article <1721@ektools.UUCP> milton@ektools.UUCP (Milton P. Bordenschnocker) writes: > Situation: I have two nearly identical directories. > One is from a backup, and the other is real. > Both contain files and sub-directories > that the other does not have. > Wish list: I would like a way of merging the two directories, > This needs to be done in such a way that in case of > duplicate files the most recent file is the one used. If the backup is via cpio you can just restore it into the the current directory without the -u flag and end up with the newest copies of everything. Otherwise you can make a cpio copy of your current directory: cd dir; find . -depth -print |cpio -ocv >file_or_tape Then restore your backup copy and update with: cd dir; cpio -icvmd