How to Force cp Command to Overwrite Without Confirmation in Linux | Linux Today

How to Force cp Command to Overwrite Without Confirmation in Linux

Written By
T
TecMint
Apr 16, 2025

The cp command (short for copy) is one of the most commonly used commands in Linux and other UNIX-like operating systems. It’s used to copy files and directories from one location to another on the same system.

If you’re copying files between systems over a network, the scp (secure copy) command is typically used instead of cp. Unlike cp, which only works locally, scp allows you to securely transfer files between your local machine and a remote server, or between two remote systems over SSH.

In this guide, we’ll focus on the cp command and show you how to force it to overwrite files without asking for confirmation on Linux.

T

TecMint

Linux Today Logo

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.