不知道的时候就可以
$ cp --help
或者
$ man cp
第一种方法的部分输出是:
Usage: cp [OPTION]... [-T] SOURCE DEST
or: cp [OPTION]... SOURCE... DIRECTORY
or: cp [OPTION]... -t DIRECTORY SOURCE...
Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.
Mandatory arguments to long options are mandatory for short options too.
-a, --archive same as -dR --preserve=all
--attributes-only don't copy the file data, just the attributes
--backup[=CONTROL] make a backup of each existing destination file
...
-d same as --no-dereference --preserve=links
...
-P, --no-dereference never follow symbolic links in SOURCE
-p same as --preserve=mode,ownership,timestamps
--preserve[=ATTR_LIST] preserve the specified attributes (default:
mode,ownership,timestamps), if possible
additional attributes: context, links, xattr,
all
--no-preserve=ATTR_LIST don't preserve the specified attributes
--parents use full source file name under DIRECTORY
-R, -r, --recursive copy directories recursively
--reflink[=WHEN] control clone/CoW copies. See below
--remove-destination remove each existing destination file before
attempting to open it (contrast with --force)
--sparse=WHEN control creation of sparse files. See below
--strip-trailing-slashes remove any trailing slashes from each SOURCE
argument
...
里面提了 -a 相当于 -dR --preserve=all
-d 是不跟随符号链接;R 是递归拷贝。在拷贝目录的时候需要,会把子目录一并拷贝。否则默认是不拷贝目录的。-p 描述是否保留源文件属性的。说明有点长,自己看吧。
一般归档用 tar 更多些,楼主如果有兴趣也可以去看看 tar 的手册页。
[
本帖最后由 pangding 于 2012-9-14 20:52 编辑 ]