Use ditto to Copy Files & Directories Intelligently from the Mac Terminal
Most longtime command line users rely on the cp command to copy files and directories, but Mac OS X offers another solution with the ‘ditto’ command. Ditto is slightly more advanced but can be advantageous to ‘cp’ for several reasons, as it not only preserves ownership attributes and permissions but also file resource forks and file and folder metadata, essentially insuring that the file and/or folders are copied exactly.
Additionally, ditto can be used to copy a file or folder to a source directory, but if that source doesn’t yet exist, ditto will automatically create it. Also, if the destination folder does exist, the copied contents will be merged together in that destination directory. Finally, ditto also follows symbolic links, making it particularly handy if you’re a heavy user of the ln command.
To better understand the ditto command, let’s run through a few examples with real syntax.







Apple is said to be launching an all new wearable device with health-monitoring abilities this October, according to two reports from reliable sources. Commonly referred to as the iWatch by existing rumors, the device is said to be a ‘watch-like’ item that is worn by the user. 


Nearly every iPhone owner who uses their device as a camera will inevitably get the “Cannot Take Photo – There is not enough available storage to take a photo.” alert message at some point, indicating their iPhone is so full of stuff that there’s no room for any additional pictures. While it’s indeed true that the device is full and that Camera app won’t work any longer until some storage has been freed up, you can almost always use a workaround to continue taking pictures anyway, at least for a little while. You may even get a few dozen more pictures out of this, and in a pinch that can be the difference of capturing an important moment or not.





