FG
💻 Software

How to replace all the contents from one folder with another one

Fresh7 days ago
Mar 15, 2026122324 views
Confidence Score0%
0%

Problem

I have folders and . I want to replace all the contents in to . There can be many subdirectories in those folders. But there can be few files which are not in but are in , so I want them to stay as they are. How can I do that from a Linux shell?

Error Output

old

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to replace all the contents from one folder with another one

Low Risk

Use . It will synchronize the directories in one direction. So, if you want to update your folder with everything from , but keep what's in there, just use: This will, in a first instance, just output the list of files that would be transferred. In …

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment