Find all files with the extension ".txt" in the entire file system, sort them randomly, take the last one, and write its contents to a file called "somefile.txt" in the /tmp directory.
find / -name '*.txt' -print | sort -R | tail -n 1 | xargs tee /tmp/somefile.txt