请问:linux把一个文件夹中的所有的文件夹和文件复制到另外一个文件夹得问题
发布网友
发布时间:2022-04-25 19:31
我来回答
共1个回答
热心网友
时间:2023-10-14 14:39
You can copy the content of a folder /source to another existing folder /dest with the command
cp -a /source/. /dest/
The -a option is an improved recursive option, that preserve all file attributes, and also preserve symlinks.
The . at end of the source path is a specific cp syntax that allow to copy all files and folders, included hidden ones.
Hence, the answer to your question is that, you should replace "-r" with "-a" in your command.