Separate names with a comma.
Discussion in 'macOS' started by ///alpinepower, Jan 19, 2010.
what is the difference between cp and ditto and other file copy commands?
It used to be that ditto was the only thing that would copy resource forks and the like, but nowadays cp does this as well (at least on MacOS X). So mostly the reasons for using it are historical.
The only reason I can think of for using it nowadays is that you can tell it to only copy the code segments for a single executable type (like PPC, i386, or x86_64). That would make things a little smaller (not really much), or force a program to run in a given mode (ie: 32bit, or rosetta).
Oh, and it can "copy" things in to or out of CPIO (the compression that pkg's use) or PKZip formats, or a couple other tricks you can pull around packages.
At one point you had to use ditto so that the copy operation would include the resource fork. Now cp AFAIK includes the resource for so it becomes more of a personal preference (I use cp)
It's probably better to get in the habit of using CP. If you ever end up in front of another unix, ditto won't be available.
Or Linux for that matter
Thanks - I had always used cp, but the 'genius' bar guy replacing a hard drive on my wife's computer had some preference for ditto that he could not explain to me......