Home Linux Basics Copy files from dir1 to dir2 without replacing the existing files on dir2

Copy files from dir1 to dir2 without replacing the existing files on dir2

by SupportPRO Admin

Copy files from dir1 to dir2 without replacing the existing files on dir2

[root@twenty ]# ls

dir1  dir2

[root@twenty ]# ls dir1

a  b  c  d  e  f

[root@twenty ]# ls dir2

a  b  c

[root@twenty ]# yes n | cp -i dir1/* dir2 2>/dev/null

[root@twenty ]# ls dir1

a  b  c  d  e  f

[root@twenty ]# ls dir2

a  b  c  d  e  f

If you require help, contact SupportPRO Server Admin

Server not running properly? Get A FREE Server Checkup By Expert Server Admins - $125 Value

Leave a Comment