# move n files from dir1 to dir2
ls -Q dir1 | head -n | xargs -i mv dir1/{} dir2/
for example
$ tree -d
.
├── annotations
├── train2017 #40,000items
└── val2017 #0items
# move 2400 files from train2017 to val2017
$ ls -Q ./train2017/ | head -2400 | xargs -i mv train2017/{} val2017/
$ tree -d
.
├── annotations
├── train2017 #37,600items
└── val2017 #2,400items