Copy files from one directory into an existing directory

前端 未结 7 1160
野趣味
野趣味 2020-12-07 08:11

In bash I need to do this:

  1. take all files in a directory

  2. copy them into an existing directory

How do I do this? I tried

7条回答
  •  广开言路
    2020-12-07 08:24

    What you want is:

    cp -R t1/. t2/
    

    The dot at the end tells it to copy the contents of the current directory, not the directory itself. This method also includes hidden files and folders.

提交回复
热议问题