How to copy a directory structure but only include certain files (using windows batch files)

前端 未结 15 1736
半阙折子戏
半阙折子戏 2020-12-07 07:50

As the title says, how can I recursively copy a directory structure but only include some files. E.g given the following directory structure:

folder1
  folde         


        
15条回答
  •  无人及你
    2020-12-07 08:28

    try piping output of find (ie. the file path) into cpio

    find . -type f -name '*.jpg' | cpio -p -d -v targetdir/
    

    cpio checks timestamp on target files -- so its safe and fast.

    remove -v for faster op, once you get used to it.

提交回复
热议问题