How can I copy a directory structure dir1 to dir2 ? (with all the subdirectories) in unix using the terminal window
|
Note You should be careful when using the You may want to use the * wildcard to copy all of the files in the directory if you need to. |
|||||||||||||
|
|
While the
Why the heck would you do that? Because tar has a fairly sophisticated understanding of links both hard and symbolic. Do you want you copy to replace existing symbolic links with one that have the same text? Or with links to the same target (adjusting relative paths to compensate)? Or with bitwise copies of the target? If two files in the original are hard linked should the new structure have two copies of the data or just one? Decisions, decisions. Tar has sensible defaults, but lets you be very specific about it. |
|||
|
|
|
I like
Rsync is another good tool for this
|
|||
|
|