linux command - 拷贝某文件夹下,按名称排序后前n个文件

时间:2021-09-05 23:27:14   收藏:0   阅读:49
find ../ImageAll_V1_part1/mask/ -maxdepth 1 -type f | sort | head -n 40 | xargs cp -t ./

 https://askubuntu.com/questions/662339/sort-files-alphabetically-before-processing

https://unix.stackexchange.com/questions/29214/copy-first-n-files-in-a-different-directory

https://unix.stackexchange.com/questions/12976/how-to-move-100-files-from-a-folder-containing-thousands

 

using find with xargs:

https://shapeshed.com/unix-xargs/

原文:https://www.cnblogs.com/imoon22/p/15225255.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!