Skip to content

Instantly share code, notes, and snippets.

@korniltsev
Created June 3, 2013 14:23
Show Gist options
  • Select an option

  • Save korniltsev/5698503 to your computer and use it in GitHub Desktop.

Select an option

Save korniltsev/5698503 to your computer and use it in GitHub Desktop.
HOWTO Merge Folder Trees (...using the command line)
HOWTO Merge Folder Trees (...using the command line)
There comes a time when you need to do this sort of thing and the Finder’s default behavior (which is to completely replace folder contents, rather than merge them as in Windows) just gets in the way.
Regardless of the reasons for this behavior and its counter-intuitiveness for those not accustomed to the UNIX way, it’s sometimes necessary to merge two folder trees with the minimum of fuss, and there are three ways to do it:
# The standard UNIX way
cp -R -v source/. destination
# The geeky UNIX way (restartable)
rsync -vaEW source/ destination
# The OSX "easy" way
ditto -V source destination
http://taoofmac.com/space/HOWTO/Merge%20Folders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment