Find all files in the current directory (denoted by ~) whose name ends with ".txt", sort them randomly, take the first one, and print its contents.
find ~/* -iname "*.txt" | sort -R | head -n 1 | xargs cat