Contents
If you want to copy directory, including all its files and subdirectories, use -R or -r option with cp command. The above command will create a destination directory and copy all files and subdirectories recursively to the /opt directory.
How do I copy a subfolder from one folder to another?
Move or Copy Files in Subfolders to a Single Folder
- Open a Command Prompt window.
- Run the following commands, one by one and press ENTER after each line: md “d:all snaps” cd /d “d:vacation snaps2016” for /r %d in (*) do copy “%d” “d:all snaps”
How do you copy and paste a folder in Linux?
In order to copy a directory on Linux, you have to execute the “cp” command with the “-R” option for recursive and specify the source and destination directories to be copied.