1. 从一个文件夹中随机拷贝一定数量的图片,放到另外一个文件夹中
find img_path_one -name '*.jpg' | shuf -n1000 | xargs -i cp {} img_path_two
注释:该命令从img_path_one中找到所有以.jpg结尾的文件,打乱后取出1000个文件,然后将这1000个文件存放在img_path_two中。
find img_path_one -name '*.jpg' | shuf -n1000 | xargs -i cp {} img_path_two
注释:该命令从img_path_one中找到所有以.jpg结尾的文件,打乱后取出1000个文件,然后将这1000个文件存放在img_path_two中。