Merge directories in Mac OS X

Aug 12, 2010 - 2 Comments

You can quickly merge any two directories within Mac OS X by using the command line tool ditto. Launch the Terminal and use the following syntax:

ditto directory1 directory2

If a directory already exists at the destination (directory2) then the contents of the source (directory1) will be merged with the contents of the destination (destination2). So I want to merge pictures from “August 2010″ into “Summer 2010″ I will use:

ditto "August 2010" "Summer 2010"

The man page for ditto describes further:

In its first form, ditto copies one or more source files or directories
to a destination directory. If the destination directory does not exist
it will be created before the first source is copied. If the destination
directory already exists then the source directories are merged with the
previous contents of the destination.

If you’re not familiar with the command line, you may want to just use the GUI to perform this type of action.

Related articles:

Posted by: Manish Patel in Command Line, Mac OS X, Tips & Tricks

2 Comments

» Comments RSS Feed

  1. Roger says:

    really? REALLY???
    Mac users usually aren’t a tech savvy as Windows users and definitely not as Linux users, both of which (OSs) do this SIMPLY. Now I have to explain to a customer they must use the terminal (which they didn’t know existed) and this long syntax for the directories to do this. Why this is not possible from Apples amazing OS GUI interface is beyond me. It is one thing to not do something as default, but for it to not do it all…? Really?

Leave a Reply

 

Shop for Apple & Mac Deals on Amazon.com

Subscribe to OSXDaily

Subscribe to RSS Subscribe to Twitter Feed Follow on Facebook Subscribe to eMail Updates

Shared on Facebook

Shop at Amazon

Ad

OSXDaily on Facebook