LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   copy without overwrite prompt (https://www.linuxquestions.org/questions/linux-newbie-8/copy-without-overwrite-prompt-667458/)

nanda22 09-04-2008 12:51 AM

copy without overwrite prompt
 
Hi,
I was trying to copy a folder of size morethan 20 GB, but somehow system got stuck and i rebooted the system. now when i'm again trying to copy the same folder, it is giving overwrite prompt, for every file, even when i used '-f' . The command which i'm using is:
cp -fr 2008/AUG/ 2008/
Please help me

Mr. C. 09-04-2008 01:01 AM

cd 2008/AUG; tar -cvf - . | ( cd /path/to/new/2008 ; tar -xvpf - )

nanda22 09-04-2008 05:21 AM

Thanks Mr C for ur kind reply.

I used "unalias cp" command whcih i got from previous post. that too worked fine. thank u LQ

Mr. C. 09-04-2008 11:46 AM

If you want to avoid an alias, use backslash for a one shot:

$ \cp src dest

i92guboj 09-04-2008 11:54 AM

Or just

Code:

yes | cp <whatever else>

nikeshp 10-26-2010 02:47 PM

Most linux are coming with an alias for cp to cp -i

So use absolute path (/bin/cp) for copy without prompt.

syntax: /bin/cp source destination

This will work.

Thanks
Nikesh

trieuphu 07-11-2011 12:41 AM

Thank nikeshp, It cool!


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