---

How to Force cp Command to Overwrite Without Confirmation in Linux

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.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis