From: Pádraig Brady Date: Tue, 20 Jan 2026 19:23:42 +0000 (+0000) Subject: doc: cp: group related -HLP descriptions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49cabb684599718cae0b9415f315ab0736f2960f;p=thirdparty%2Fcoreutils.git doc: cp: group related -HLP descriptions * src/cp (usage): The -HLP options are close in functionality and close alphabetically, so describe together. * doc/coreutils.texi (cp invocation): Likewise. --- diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 34f1b775fe..4a098e24ec 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8794,12 +8794,6 @@ This option is independent of the @option{--interactive} or This option is ignored when the @option{--no-clobber} or @option{-n} option is also used. -@optItem{cp,-H,} -If a command line argument specifies a symbolic link, then copy the -file it points to rather than the symbolic link itself. However, -copy (preserving its nature) any symbolic link that is encountered -via recursive traversal. - @optItem{cp,-i,} @optItemx{cp,--interactive,} When copying a file other than a directory, prompt whether to @@ -8807,9 +8801,11 @@ overwrite an existing destination file, and fail if the response is not affirmative. The @option{-i} option overrides a previous @option{-n} option. -@optItem{cp,-l,} -@optItemx{cp,--link,} -Make hard links instead of copies of non-directories. +@optItem{cp,-H,} +If a command line argument specifies a symbolic link, then copy the +file it points to rather than the symbolic link itself. However, +copy (preserving its nature) any symbolic link that is encountered +via recursive traversal. @optItem{cp,-L,} @optItemx{cp,--dereference,} @@ -8818,16 +8814,6 @@ With this option, @command{cp} cannot create a symbolic link. For example, a symlink (to regular file) in the source tree will be copied to a regular file in the destination tree. -@optItem{cp,-n,} -@optItemx{cp,--no-clobber,} -Do not overwrite an existing file; silently skip instead. -This option overrides a previous @option{-i} option. -This option is mutually exclusive with @option{-b} or @option{--backup} option. -This option is deprecated due to having a different exit status from -other platforms. See also the @option{--update} option which will -give more control over how to deal with existing files in the destination, -and over the exit status in particular. - @optItem{cp,-P,} @optItemx{cp,--no-dereference,} @cindex symbolic links, copying @@ -8841,6 +8827,20 @@ Use this option only when the destination directory's contents are trusted, as an attacker can place symlinks in the destination to cause @command{cp} write to arbitrary target directories. +@optItem{cp,-l,} +@optItemx{cp,--link,} +Make hard links instead of copies of non-directories. + +@optItem{cp,-n,} +@optItemx{cp,--no-clobber,} +Do not overwrite an existing file; silently skip instead. +This option overrides a previous @option{-i} option. +This option is mutually exclusive with @option{-b} or @option{--backup} option. +This option is deprecated due to having a different exit status from +other platforms. See also the @option{--update} option which will +give more control over how to deal with existing files in the destination, +and over the exit status in particular. + @optItem{cp,-p,} @optItemx{cp,--preserve,[=@var{attribute_list}]} @cindex file information, preserving, extended attributes, xattr diff --git a/src/cp.c b/src/cp.c index fa464f2c40..e17484b5d5 100644 --- a/src/cp.c +++ b/src/cp.c @@ -209,18 +209,10 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\ oputs (_("\ -H\n\ follow command-line symbolic links in SOURCE\n\ -")); - oputs (_("\ - -l, --link\n\ - hard link files instead of copying\n\ ")); oputs (_("\ -L, --dereference\n\ always follow symbolic links in SOURCE\n\ -")); - oputs (_("\ - -n, --no-clobber\n\ - (deprecated) silently skip existing files. See also --update\n\ ")); oputs (_("\ -P, --no-dereference\n\ @@ -229,6 +221,14 @@ Copy SOURCE to DEST, or multiple SOURCE(s) to DIRECTORY.\n\ oputs (_("\ --keep-directory-symlink\n\ follow existing symlinks to directories\n\ +")); + oputs (_("\ + -l, --link\n\ + hard link files instead of copying\n\ +")); + oputs (_("\ + -n, --no-clobber\n\ + (deprecated) silently skip existing files. See also --update\n\ ")); oputs (_("\ -p\n\