Get random numbers or random words in Linux command line with shuf.

Get a random port number with shuf command:

shuf -n 1 -i 1024-65535

Write it directly into a new variable:

RANDOM_PORT=`shuf -i 1024-65535 -n 1`

Get random word from a word list:

shuf -n 1 /usr/share/dict/words