Question: How Copy Overwrite File in Linux?
Contents How Copy Overwrite Folder in Linux? the Best Way to Force the Overwrite Is to Use a Backward Slash Before the Cp Command as Shown in the Following...
Contents
How copy overwrite folder in Linux?
The best way to force the overwrite is to use a backward slash before the cp command as shown in the following example. Here, we are copying contents of the bin directory to test directory. Alternatively, you can unalias the cp alias for the current session, then run your cp command in the non-interactive mode.
Must Read
Does Linux cp command overwrite?
By default, cp will overwrite files without asking. If the destination file name already exists, its data is destroyed. If you want to be prompted for confirmation before files are overwritten, use the -i (interactive) option.