I want to copy a directory from:
path1/dir1
to
path2/dir2
the first time I invoke
cp -r path1/dir1 path2/dir2
there's no problem, dir2 is created under path2
ls path2/dir2
bu the 2nd time, dir1 is created under path2/dir2
ls path2/dir2/dir1
Can I get the correct behavior using only cp
? (= without invoking rm -f path2/dir2
)
dir2
withdir1
inpath2/
? – Apr 14 '14 at 10:12