Take one random file from the /bin/files directory, get its file type, print the file type to a new file called newfile.txt.
shuf -n 1 /bin/files/* | xargs file -b | awk '{print "echo " $0 " > newfile.txt"}' | sh