Add a "-n" option to cp (opposite of "-f")

Bug #229182 reported by Philipp Kohlbecher
6
Affects Status Importance Assigned to Milestone
coreutils (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: coreutils

Here's a wishlist item:

The BSD version of cp(1) has a "-n" command line option (cf. http://www.freebsd.org/cgi/man.cgi?query=cp&sektion=1). It means: "Do not overwrite an existing file."

This is a pretty nice thing to have if you want to copy a bunch of files from A to B without replacing any of the files in B (regardless of their modification time). With this version of cp(1), you have to do something like "yes no | cp -i A/* B/*", which is unnecessarily complicated. cp(1) has the "-f" switch and the "-i" switch, it should have the corresponding "-n" switch.

Thanks for considering!

Revision history for this message
Kamil Dudka (kdudka) wrote :

I think it could be useful, did anybody propose this to coreutils upstream?

Revision history for this message
C de-Avillez (hggdh2) wrote :

Hello Kamil,

No, nobody has, at least from here (if someone had, the bug would have been updated, at least I hope so).

Please feel free to email bug-coreutils on that (and update the bug accordingly).

Revision history for this message
Kamil Dudka (kdudka) wrote :
Revision history for this message
Kamil Dudka (kdudka) wrote :
Revision history for this message
C de-Avillez (hggdh2) wrote :

Marking as fix committed (upstream). Depending on the release of coreutils-7.0, we might get it on Jaunty.

Thanks, Kamil.

Changed in coreutils:
status: New → Fix Committed
Revision history for this message
C de-Avillez (hggdh2) wrote :

Marking as fix released, Karmic, coreutils 7.4.

Changed in coreutils (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.