Copy from cp

Copy from cp

Copy from rsync

Copy from rsync

First screen: Why does cp make a folder from a link? How to fix it with cp?

The second screen: rsync copied as I expected. Should I always use rsync instead of cp?

Closed due to the fact that the issue is too general for the participants gbg , user194374, aleksandr barakin , Streletz , lexxl Aug 8 '16 at 16:06 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • What problem are you solving? - gbg
  • @dbg, questions under screenshots - Sergey
  • In fact, you specified cp table of contents (and not its contents, which you apparently wanted ( cp -R test1/link_to_1/* test2/link_to_1 )), so you copied it (recursively) to test2/1 . - avp pm
  • By the way, you have a strange screenshot. Such a result should be obtained for cp -RL ... ... (-L causes cp to "open links"). In your case of cp -R ... ... it was the symbolic link link_to_1 that pointed to the name 1 should be copied to test2/1 1 . Check again. - avp
  • @avp, cp -R test1/link_to_1 test2/link_to_1/ - link is copied; cp -R test1/link_to_1/ test2/link_to_1/ - the link turns into a folder; cp -R test1/link_to_1/* test2/link_to_1/ - source content is copied; - Sergey

0