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中。