How to recursively copy directories in Linux

subject: Commands · date: 2017-12-08

  • Copy a folder recursively to another location:

    $ cp -r <path/to/folder> <path/to/copy>
    
  • Copy a folder recursively into another folder, keeping the folder name:

    $ cp -r <path/to/folder> <path/to/target/parent/folder>
    
  • Copy the contents of a folder into another folder:

    $ cp -r <path/to/source/folder/*> <path/to/target/folder>
    

read more

share this article