Skip to content

man cp doesn’t document the -R option #6223

@LucasLarson

Description

@LucasLarson

The manpage for cp/ucp shows the --recursive and -r options for recursive copying, but does not mention -R. All of the following work exactly as expected after running rm -rf directory elsewhere && mkdir directory:

$ "$(brew --prefix uutils-coreutils)"/libexec/uubin/cp -r          directory elsewhere
$                                                  ucp -r          directory elsewhere


$                                                  ucp --recursive directory elsewhere
$ "$(brew --prefix uutils-coreutils)"/libexec/uubin/cp --recursive directory elsewhere


$ "$(brew --prefix uutils-coreutils)"/libexec/uubin/cp -R          directory elsewhere
$                                                  ucp -R          directory elsewhere

but the last two lines use -R, which is undocumented in the manpage, and is the only POSIX-guaranteed option for recursive copying.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions