I have a directory of more than one million images, categorized according to the place the image was captured. Now theses places are again sorted alphabetically into folders. For example,
--- Images
|____ a
| |___ airfield
| |___ alley
|
|____ b
|___ bank
|__ bank-00001.jpg
|__ bank-00002.jpg
.
.
.
How can I copy the first 100 files from each place subdirectory such as airfield, alley, bank etc. to a different folder ?
I have tried:
find /Source/Directory/path -type f -print | tail -100 | xargs -J % cp % /Destination/Diretory/path
but I am guessing it overwrote the images, because only the last 100 images of the last subfolder were copied.
My bash version
GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin16)
Copyright (C) 2007 Free Software Foundation, Inc.