FG
💻 Software

Copy files in Linux, avoid the copy if files do exist in destination

Fresh5 days ago
Mar 15, 2026193163 views
Confidence Score1%
1%

Problem

I need to copy a /home/user folder from one hard disk to another one. It has 100,000 files and around 10G size. I use sometimes I get some errors due to broken links, permissions and so on. So I fix the error, and need to start again the copy. I wonder how could I tell the command "cp", once it tries to copy again, not to copy files again if they exist in the destination folder.

Error Output

cp -r /origin /destination

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Copy files in Linux, avoid the copy if files do exist in destination

Low Risk

Just use . From man page: -n, --no-clobber do NOT overwrite an existing file (overrides a previous -i option)

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment