I'm trying to merge two directory trees that have many common elements but also each have elements that are only present in one of the two trees. The main issue I am having is that when mv encounters two sub-directories with the same relative paths it either keeps the source (with -f) or the destination (with -n) but I can't make it take the union of both sub-directories. I could of course use rsync with --remove-source-files but this will actually copy the data and then delete the old files as opposed to a true move. The two directory trees contain several hundred GB of data and are both on same partition so I would love to do a true move if possible for the sake of time. Right now I have find * -type file -exec mv -n {} /destination/{} but this only moves  files from the source to the destination when the target directory already exists. I can preface this command with something like mv -n * /destination/ but this only brings over the top level directories. Is there any way to do this in a single line? I could  always write a script to check if the directory exists before copying the file but this seems like such a basic task, it seems like there should be an easier way.
mv with rsync functionality
find;rsync;mv
Warning: This answer will not work on file systems that do not support hard links (e.g., FAT).Another option (which may be more portable) iscd source_directoryfind . -type f -print0 | cpio --pass-through --null --link --make-directories dest_dircpio (copy in&out) is a dinosaur that predates tar.Like tar, it can create or extract from archives.Unlike tar (correct me if Im wrong),it can copy directory trees with a single command.(I guess you could do this with tar -cf - source option(s) and arguments(s) | tar -xf - destination option(s) and arguments(s).)Thats what --pass-through means.--null means expect filenames to be delimited by nulls;i.e., read output from find  -print0.--link means link files from the source directory into the destination directory,if possible.--make-directories needs no explanation.This can be abbreviated cpio p0ld dest_dir.Add --verbose or -v if you want.Then, after this finishes,Check for collisions and handle appropriately.Verify that your destination directory is populated with hard links.Remove the source directory.