Copy the linux command [] [cp] scp

case1: on the same server, copy all the contents of a folder to another folder

#如果dir2不存在
cp -r dir1 dir2
#如果dir2已存在
cp -r dir1/. dir2

case2: In the two servers, copy all the contents of a folder to a file server to another folder

#如果dir2不存在
scp -r [email protected]:/path/dir1 /path/dir2
#如果dir2已存在
scp -r [email protected]:/path/dir1/. /path/dir2

To be continued

Published 18 original articles · won praise 3 · views 20000 +

Guess you like

Origin blog.csdn.net/hyluglare/article/details/89294394