且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

整个目录结构的每一个文件复制到另一个基本路径

更新时间:2023-11-27 22:48:10

您正在寻找办法,以扁平化的目录

you are looking for ways to flatten the directory

find /images -iname '*.jpg' -exec cp --target-directory /newfolder/ {} \;

找到所有文件 INAME 在不区分大小写的名字模式。结果
CP 一旦复制到 - 目标目录名为 / newfolder / 。结果
{} 扩大从在列表中找到成的形式 /dir/file.jpg / DIR / DIR2 / bla.jpg

find all files iname in case insensitive name mode.
cp copy once to --target-directory named /newfolder/.
{} expand the list from find into the form of /dir/file.jpg /dir/dir2/bla.jpg.