JP Vossen on 20 Apr 2011 22:38:30 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Merging home directories

Date: Wed, 20 Apr 2011 20:04:20 -0400
From: Gordon Dexter<>

I have the unenviable task of merging 5 different home directories from
three different computers, spanning 5 years, and I was wondering if there
was any tool that might simplify things.  My eventual goal is to have one
unified, well organized home directory that is versioned (e.g. via Git) and
synced between multiple computers.  The last few times I've moved or
upgraded I just put the previous home directory as a subfolder of the newer
one, so on one computer I have /home/gdexter/old_gdexter/older_gdexter and I
haven't even gotten around to doing that on my newest computer.  This is
compounded by bad habits such as putting things on the desktop if I don't
know what to do with them.

I'd rather not lose anything, of course, but I'd also rather not go through
each homedir item by item and manually copy or merge things.  Are there
tools that help you with this sort of thing?  Any suggestions to save my



Then, go through and nuke or move anything obvious.

My next thought is to recursively md5sum all the files, then pick out and remove the dups, to trim it down. (Yeah, I know md5 is old and broken but it's good enough for this and reasonably fast.) That'll be ugly to impossible without some command line and script knowledge though.

After that, there are some GUI tools. Meld will help compare dirs. Unison will probably do that too, though it is really intended for merging a local to a remote dir.

meld - graphical tool to diff and merge files
unison-gtk - A file-synchronization tool for Unix and Windows with GTK+ interface
xsel - command-line tool to access X clipboard and selection buffers

I've also used spreadsheets to do stuff like that. You can paste file names into columns, and match things up. 'ls -1 | xsel -bi', flip to a spreadsheet and paste.

Once I have a spreadsheet, I sometimes use formulas to create commands (like rm or mv) then paste those into a script to run all at once. That also gives me an audit of what I did, or it lets me do something similar when I mess up, restore the backup, fix my mistake, and try again.

Watch out for hidden "dot" files that may fly under the radar of some tools.

Good luck,
JP Vossen, CISSP            |:::======|
My Account, My Opinions     |=========|
"Microsoft Tax" = the additional hardware & yearly fees for the add-on
software required to protect Windows from its own poorly designed and
implemented self, while the overhead incidentally flattens Moore's Law.
Philadelphia Linux Users Group         --
Announcements -
General Discussion  --