Quick Answer: How Do I Copy a Subfolder in Linux?
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

  1. Open a Command Prompt window.
  2. 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.

David Miller

David Miller

Executive Financial & Market Analyst

David Miller brings 15 years of experience in global economics, personal finance strategy, and market dynamics. He specializes in turning complex economic trends into actionable insights for everyday readers.

Share this article
Twitter Facebook Pinterest