Linux 如何从目录而不是符号链接复制内容?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10738690/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 06:29:28  来源:igfitidea点击:

How to copy contents from a directory and not symbolic link?

linux

提问by Kamath

on a directory cp -rvf dir .copies the symbolic links and not actual contents. src is copied to module/hal/

在目录上cp -rvf dir .复制符号链接而不是实际内容。src 被复制到module/hal/

.
|-- comm
|   `-- alchemist.c
|-- module
|   `-- hal
|       `-- src
|           `-- comm -> ../comm
`-- src
    `-- comm -> ../comm

采纳答案by Fred Foo

From cp(1):

来自cp(1)

   -L, --dereference
          always follow symbolic links in SOURCE