How to force cp to overwrite without confirmation

Ads
 

How to force cp to overwrite without confirmation

Hi,

I am copying files in ubuntu from one directory to another directory. But I want to replace all the files in the destination directory with new files.

How can I use the cp command?

How to force cp to overwrite without confirmation?

Thanks

View Answers

October 3, 2018 at 3:54 AM

Hi,

You can pass yes with the command.

Here is example which works:

yes | cp -rf source destination.

This example works well.

Thanks

Ads









Related Tutorials/Questions & Answers:
ffmpeg force overwrite
ffmpeg force overwrite  What is the command line option for ffmpeg force overwrite? Thanks   Hi, You can use "-y" parameter for ffmpeg force overwrite. Thanks
How to create a confirmation box?
How to create a confirmation box?  How to create a confirmation box
Advertisements
closing the internet explorer window of any version without confirmation using javascript
closing the internet explorer window of any version without confirmation using javascript  Hi all, Here is my requirement, I have to close microsoft internet explorer window on onload event without confirmation. It should
Closing any kind of browser window without confirmation using javascript
Closing any kind of browser window without confirmation using javascript  Here is my requirement, I have to close a browser window on onload event. I have tried with window.close() and self.close(). But it doesn't work. Please
Java file overwrite
Java file overwrite In this section, you will learn how to overwrite a file... can overwrite the file also by using the output streams...()); fos.close(); } } } Through the above code, you can overwrite
cp and sp
cp and sp  design a gui application to accept the cost price and selling price from the user in two textfields and then calculate the profit or loss occured
how to use confirmation alert box before delete in jsp?
how to use confirmation alert box before delete in jsp?  I use submit button.I want alert box before deleting data.   1)application.jsp: <%@ page import="java.sql.*" %> <html> <head> <script
Confirmation Mail
Confirmation Mail  hi, i need the code.when we sign up it will send the confirmation mail to the e-mail right.how to do that part.....and also help me whether the AJAX is better or PHP better for the front design
How to print a webpage without url and date in jsp ?
How to print a webpage without url and date in jsp ?  How to print a webpage without url and date in jsp
Show Confirmation Dialog on Click the Command Link
Show Confirmation Dialog on Click the Command Link  How to show Confirmation Dialog when user Click the Command Link
how to get current date without system date
how to get current date without system date  is there any possiblity to get current date instead of system date in Java, as i dont want to change date in program and if i change date in OS automatically change in program also
how to reverse a string without changing its place
how to reverse a string without changing its place  how to reverse a string without changing its place   Hi Friend, Another way of reversing string: import java.util.*; public class ReverseString{ public static
without ;
without ;  can u give me an example of a program without
without ;
without ;  can u give me an example of a program without
How to add mod_deflate to apache without recompiling
How to add mod_deflate to apache without recompiling  Hi, What is the best way to add moddeflate to the Apache server without recompiling the Apache? I have a Linux server (Centos) and I have to add the moddeflate module. How
How can we submit a form without a submit button?
How can we submit a form without a submit button?  How can we submit a form without a submit button
how to delete a row in sql without using delete command.
how to delete a row in sql without using delete command.  how to delete a row in sql without using delete command. thanks in advance
how to validate the telephone number without using jquery in html with javascript
how to validate the telephone number without using jquery in html with javascript  how to validate the telephone number without using jquery in html with javascript
how can i achieve multiple inheritance in java without using inheritance ?
how can i achieve multiple inheritance in java without using inheritance ?  how can i achieve multiple inheritance in java without using inheritance
How to Write to a File in Java without overwriting
Learn how to Write to a File in Java without overwriting in your Java program This tutorial teaches you how to write to a file in Java without overwriting... which already contains the data and our program will write to this file without
Version of com.appslandia>appslandia-common-cp dependency
List of Version of com.appslandia>appslandia-common-cp dependency
How to save form fields into the MySql Database without submit button in jsp?
How to save form fields into the MySql Database without submit button in jsp?  I want to store user inputs into the database using javasccript or ajax or jqury but without submit button. Form Contains three fields
how to test iphone app on iphone without developer program
how to test iphone app on iphone without developer program  Is it possible to test the iPhone application on different device without the UDID Key?   No, without the UDID Key no one test the application on iPhone
Need runescape 2007 gold but hate phone confirmation?
Need runescape 2007 gold but hate phone confirmation?  Do you think...? Now, Rs2sale.com solves this problem, you can buy cheapest rs 07 gold without any confirmation pay by paypal. 6% discount code for you: PPSALE
how to build a colorful clock in JSP without using Flash.
how to build a colorful clock in JSP without using Flash.  I have to make a colorful clock using java programming or some API in a JSP page. Please send me a code for it as soon as possible
force a page to go to another page using JavaScript
force a page to go to another page using JavaScript  How to force a page to go to another page using JavaScript
How to Make Money Online Without a Website
Its easy to Make Money Online Without a Website if you patience and little... without creating your own website. There lot's of skill required to register... by which you can earn money without creating your own website. Everyone around
How to compile PHP file and provide it to user without code?
How to compile PHP file and provide it to user without code?  I have created a class in PHP, that contains some useful methods. Now I want to give... in asp.net instead of providing code file. How can I compile the PHP file and provide
email confirmation - Hibernate
, than I have to update user but I am not sure how should I select user and finally
how to remove tags in HTML without functionalities? - Java Beginners
how to remove tags in HTML without functionalities?  hi to all, I create an application for converting html to ppt in java. And in this i convert the text from html to ppt and i able to remove the HTML tags from .html code
how to access the object of one frame on clicking a button without using this keyword
how to access the object of one frame on clicking a button without using this keyword  import java.awt.*; import java.awt.event.*; class Mybuttons1 extends Frame { public static void main(String args[]) { Button b1

Ads