diff options
author | Kamil Dudka <kdudka@redhat.com> | 2009-01-13 18:35:00 +0100 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2009-01-14 09:09:22 +0100 |
commit | d01338eb3d30e5634f1b4d4179c229f54eea0b44 (patch) | |
tree | 6ed873717bb12faed3300b9be390aaabee40fa74 /doc | |
parent | a99c35b04d9ab601e4fa98319c56fbdbde6b420a (diff) | |
download | coreutils-d01338eb3d30e5634f1b4d4179c229f54eea0b44.tar.gz |
cp/mv: add --no-clobber (-n) option to not overwrite target
* src/cp.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* src/mv.c (usage): Show new option -n in --help.
(main): Handle new option -n.
* doc/coreutils.texi: Document new cp/mv option -n.
* tests/cp/cp-i: Add tests for -f, -i and -n options.
* tests/mv/mv-n: New test for mv -n.
* tests/Makefile.am: Add test mv/mv-n to the list.
* NEWS: Mention the change.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 1cc237c3a..d8df10760 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -7314,6 +7314,9 @@ description of @option{--remove-destination}. This option is independent of the @option{--interactive} or @option{-i} option: neither cancels the effect of the other. +This option is redundant if the @option{--no-clobber} or @option{-n} option is +used. + @item -H @opindex -H If a command line argument specifies a symbolic link, then copy the @@ -7326,7 +7329,8 @@ via recursive traversal. @opindex -i @opindex --interactive When copying a file other than a directory, prompt whether to -overwrite an existing destination file. +overwrite an existing destination file. The @option{-i} option overrides +a previous @option{-n} option. @item -l @itemx --link @@ -7340,6 +7344,14 @@ Make hard links instead of copies of non-directories. @opindex --dereference Follow symbolic links when copying from them. +@item -n +@itemx --no-clobber +@opindex -n +@opindex --no-clobber +Do not overwrite an existing file. The @option{-n} option overrides a previous +@option{-i} option. This option is mutually exclusive with @option{-b} or +@option{--backup} option. + @item -P @itemx --no-dereference @opindex -P @@ -8099,6 +8111,11 @@ The program accepts the following options. Also see @ref{Common options}. @opindex --force @cindex prompts, omitting Do not prompt the user before removing a destination file. +@macro mvOptsIfn +If you specify more than one of the @option{-i}, @option{-f}, @option{-n} +options, only the final one takes effect. +@end macro +@mvOptsIfn @item -i @itemx --interactive @@ -8108,6 +8125,16 @@ Do not prompt the user before removing a destination file. Prompt whether to overwrite each existing destination file, regardless of its permissions. If the response is not affirmative, the file is skipped. +@mvOptsIfn + +@item -n +@itemx --no-clobber +@opindex -n +@opindex --no-clobber +@cindex prompts, omitting +Do not overwrite an existing file. +@mvOptsIfn +This option is mutually exclusive with @option{-b} or @option{--backup} option. @item -u @itemx --update |