LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-05-2010, 09:13 AM   #1
abdoullah
Member
 
Registered: May 2009
Distribution: Gentoo, CentOS
Posts: 49

Rep: Reputation: 0
Hoe to copy without overwriting


Hi Guys,
I looked in the man cp pages to find an option that allows me to copy files without overwriting and without having to answer no every time prompted (huge number of files) but i didn't find any, can you guys help me out here?
 
Old 10-05-2010, 09:26 AM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Hi,

Doesn't the -u option do what you want?

Quote:
-u, --update
copy only when the SOURCE file is newer than the destination file or when destination file is missing.
Hope this helps.
 
Old 10-05-2010, 09:46 AM   #3
abdoullah
Member
 
Registered: May 2009
Distribution: Gentoo, CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by druuna View Post
Hi,

Doesn't the -u option do what you want?



Hope this helps.
yes this helps, thanks a lot, this solve half of my issue though, cause my source files are newer than destination ones and even though i don't want new files to replace old files if exist already. what i'll do is i'll change time stamp before copying.
Thanks once more!!
 
Old 10-05-2010, 09:51 AM   #4
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
You're welcome

BTW: Can you put the SOLVED tag on this thread (first post, the Thread Tools pull down menu).
 
Old 10-05-2010, 01:23 PM   #5
raviteja_s
Member
 
Registered: Jun 2010
Location: India
Distribution: Redhat
Posts: 68

Rep: Reputation: 1
rsync -rHhlAp
 
Old 10-05-2010, 03:26 PM   #6
abdoullah
Member
 
Registered: May 2009
Distribution: Gentoo, CentOS
Posts: 49

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by raviteja_s View Post
rsync -rHhlAp
thanks! this also does the same.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
hoe to install wine miroslavk3 Linux - Software 3 04-13-2010 09:28 AM
How do I copy over directories to directories with the same name without overwriting? SentralOrigin Linux - General 1 03-14-2009 02:09 AM
How to copy files without overwriting? Stephan_Craft Linux - Newbie 7 02-17-2009 06:28 AM
hoe to install ns-2 rajanbabu Linux - Networking 1 02-08-2009 11:34 AM
How to copy without overwriting [KIA]aze Linux - Newbie 4 03-08-2007 08:42 AM


All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration