Copy files from one directory into an existing directory

前端 未结 7 1151
野趣味
野趣味 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:19

    For inside some directory, this will be use full as it copy all contents from "folder1" to new directory "folder2" inside some directory.

    $(pwd) will get path for current directory.

    Notice the dot (.) after folder1 to get all contents inside folder1

    cp -r $(pwd)/folder1/. $(pwd)/folder2
    

提交回复
热议问题