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