08/01/2010

console copy without overwriting

To copy an arbitrary number of files without overwritting existing ones, use:
yes n | cp -i <source> <destination>
Found here.
Note that this does not work for scp, as there is no -i option. A workaround proposed here suggests setting previously copied files read-only - which you can't do on FAT or NTFS partitions, btw.

No comments: