Copy Random Files
You could use shuf
:
shuf -zn8 -e *.jpg | xargs -0 cp -vt target/
shuf
shuffles the list of*.jpg
files in the current directory.-z
is to zero-terminate each line, so that files with special characters are treated correctly.-n8
exitsshuf
after 8 files.xargs -0
reads the input delimited by a null character (fromshuf -z
) and runscp
.-v
is to print every copy verbosely.-t
is to specify the target directory.
Comments
Post a Comment