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

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/

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

上一篇:045.数组-一维数组-冒泡排序


下一篇:Java从0到架构师②JavaEE技术基石