I'm curious. As far as cp
and rsync
I see all these different options. Correct me if I'm wrong, but if you copy + paste in Finder, lets say from one hard drive to another, it should preserve:
-
All file attributes (access time, modified time etc.)
-
All Symbolic Links
-
Recurse through the directory structure
-
(Can't think of anything else to preserve)?
So in the end, when you copy paste in Finder, everything will be an exact copy, just located in a different parent directory.
What I'm looking for is a command that mimics exactly what Finder does when you copy + paste. That will answer this question…
If it turns out Finder doesn't do what I think it does please explain, and show the command line equivalents for what Finder actually does… it must be calling a command when you use the GUI – right?
Best Answer
If you want to preserve file attributes, symbolic links, and recursive structure,
rsync
should suffice:The
-a
(archive) flag is a shortcut for the followingrsync
options: