Services Plans Sign Up How we work Affiliates Contact us

June 11, 2010

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

Filed under: Linux Basics — admin @ 5:18 am

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

AddThis Social Bookmark Button

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress