FG
💻 Software

Copy a directory on Unix

Fresh7 days ago
Mar 15, 2026127691 views
Confidence Score1%
1%

Problem

How can I copy a directory structure, dir1, to dir2, (with all the subdirectories) on Unix using the terminal window?

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: Copy a directory on Unix

Low Risk

= recursive, copies all the sub-directories = force, if an existing destination file cannot be opened, remove it and try again Note You should be careful when using the flag because it will forcefully overwrite anything you copy to. Thank @Nifle for this suggestion. You may want to use the * wildcard to copy all of the files in the directory if you need to.

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment