LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 09-04-2008, 01:51 AM   #1
nanda22
Member
 
Registered: Mar 2008
Posts: 58

Rep: Reputation: 15
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
 
Old 09-04-2008, 02:01 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 61
cd 2008/AUG; tar -cvf - . | ( cd /path/to/new/2008 ; tar -xvpf - )
 
Old 09-04-2008, 06:21 AM   #3
nanda22
Member
 
Registered: Mar 2008
Posts: 58

Original Poster
Rep: Reputation: 15
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
 
Old 09-04-2008, 12:46 PM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

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

$ \cp src dest
 
Old 09-04-2008, 12:54 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,074

Rep: Reputation: 386Reputation: 386Reputation: 386Reputation: 386
Or just

Code:
yes | cp <whatever else>
 
Old 10-26-2010, 03:47 PM   #6
nikeshp
Member
 
Registered: Jan 2010
Location: Cochin
Posts: 35

Rep: Reputation: 0
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
 
Old 07-11-2011, 01:41 AM   #7
trieuphu
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
Thank nikeshp, It cool!
 
  


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
Preventing overwrite prompt when copying thetawaverider Fedora 1 10-04-2006 05:34 PM
How do you copy and paste a file from a command prompt? thenewguy05 Linux - Newbie 6 07-13-2004 04:41 PM
Copy and Overwrite jrdioko Linux - Newbie 2 06-29-2004 12:46 PM
copy command with out prompt imsajjadali Red Hat 4 05-31-2004 12:42 AM
overwrite directory copy medamnit Linux - Newbie 1 05-26-2002 01:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:25 PM.

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