Randomly select 5 numbers between 0 and 9, and for each number, search the file /usr/share/dict/words for words that are two characters long and have the same first and last character.
shuf -i 0-9 -n 5 | xargs -I {} grep -E '^[{}-{}]{2}$' /usr/share/dict/words