LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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, 12: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, 01:01 AM   #2
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
cd 2008/AUG; tar -cvf - . | ( cd /path/to/new/2008 ; tar -xvpf - )
 
Old 09-04-2008, 05: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, 11:46 AM   #4
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

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

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

Rep: Reputation: 405Reputation: 405Reputation: 405Reputation: 405Reputation: 405
Or just

Code:
yes | cp <whatever else>
 
Old 10-26-2010, 02: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, 12:41 AM   #7
trieuphu
LQ Newbie
 
Registered: Jul 2011
Posts: 1

Rep: Reputation: Disabled
Thank nikeshp, It cool!
 
  


Reply



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

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

All times are GMT -5. The time now is 02:04 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
Open Source Consulting | Domain Registration