Moving 3 pics randomly to another directory

I am using Linux and I’m in a folder it has 10 .jpg images I want to move 3 pictures only without selection by name or size for example my folder is /sdcard /DCIM/camera/ I want 3 pictures from it to /sdcard using a Linux command it’s possible? Thanks

Asked By: WoLFyy THETHE

||

There are a lot of commands possible to do it.

That’s a suggestion:

cd /sdcard/DCIM/camera/
i=0
for x in *.jpg; do
  if [ "$i" = 3 ]; then break; fi
  mv "$x" /sdcard
  i=$((i+1))
done
Answered By: Redbob
Categories: Answers Tags: , , , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.