Case 1: If dst
does not exist, then cp -vr src dst
creates dst
and copies all the content from src
to dst
:
$ cp -vr src dst
'src' -> 'dst'
'src/t0.c' -> 'dst/t0.c'
Case 2: If dst
does exist, then cp -vr src dst
creates dst/src
and copies all the content from src
to dst/src
:
$ cp -vr src dst
'src' -> 'dst/src'
'src/t0.c' -> 'dst/src/t0.c'
Question: For case 1
: is there any option that will make cp
trigger No such file or directory
error instead of creating dst
?
cp
work in a consistent manner regardless of whether or notdst
exists – Chris Davies Sep 26 '20 at 22:33