请问:linux把一个文件夹中的所有的文件夹和文件复制到另外一个文件夹得问题

2024年11月19日 19:31
有1个网友回答
网友(1):

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.