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:
How to force cp to overwrite without confirmation
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   ...How to force cp to overwrite without confirmation  Hi, I am copying
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
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
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
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
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
how to print dot in python without newline
how to print dot in python without newline  Hi, I a debugging... to print 20 dots without new line. Is there any easy solution? how to print dot in python without newline? Can I use variable to decide no of times dot
how to print dot in python without newline
how to print dot in python without newline  Hi, I a debugging... to print 20 dots without new line. Is there any easy solution? how to print dot in python without newline? Can I use variable to decide no of times dot
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
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 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 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
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 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 do I tar a directory without retaining the directory structure?
How do I tar a directory without retaining the directory structure?  Hi, I want to create tar file without retaining the directory permission. How to do this? Thanks   Use tar czf ~/backup.tgz Thanks
How do I tar a directory without retaining the directory structure?
How do I tar a directory without retaining the directory structure?  Hi, I want to create tar file without retaining the directory permission. How to do this? Thanks   Use tar czf ~/backup.tgz Thanks
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
ModuleNotFoundError: No module named 'cp'
ModuleNotFoundError: No module named 'cp'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'cp' How to remove the ModuleNotFoundError: No module named 'cp' error
ModuleNotFoundError: No module named 'cp'
ModuleNotFoundError: No module named 'cp'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'cp' How to remove the ModuleNotFoundError: No module named 'cp' error
ModuleNotFoundError: No module named 'cp'
ModuleNotFoundError: No module named 'cp'  Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'cp' How to remove the ModuleNotFoundError: No module named 'cp' error
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
how to convert string to char array in java without using tochararray
how to convert string to char array in java without using tochararray  Hi, I want to convert the String object in java without the toChararray() function. how to convert string to char array in java without using
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 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 do I become a data scientist without coding experience in India?
How do I become a data scientist without coding experience in India?  ... for the tutorials to learn: How do I become a data scientist without coding... can learn the topic "How do I become a data scientist without coding
How do I become a data scientist without a PhD?
How do I become a data scientist without a PhD?  Hi, I am beginner... to learn: How do I become a data scientist without a PhD? Try to provide me good examples or tutorials links so that I can learn the topic "How do I
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

Ads