抽取当前目录以下的所有logo1.* 或 logo2.* 到 /media/logo下
tar cvf - `find . -name "logo[1,2].*" -print` | (cd /media/logo;tar xvf - )
缺点:因为是拷贝所以占用多一倍空间。
如果文件列表多于3000个以上方法不行的,用下边的方法:
find . -name '*.txt' -print >/tmp/test.manifest
tar -cvzf textfiles.tar.gz --files-from /tmp/test.manifest
find . -name '*.txt' | xargs rm -v
本文介绍了一种使用Linux命令行工具批量移动目录中的logo1.*和logo2.*文件至指定目录的方法,并讨论了当文件数量过多时的替代方案。
1万+

被折叠的 条评论
为什么被折叠?



