Nowadays, strong passwords are often required, which are normally made of alphanumeric and optionally some punctuations. Sometimes, it's not easy to come up with a good password on your own. The device file /dev/urandom can help you in such a situation. /dev/urandom is a special file found on Linux and *BSD that serves as a pseudo-random number generator (PRNG). It gives you a sequence of random bits when you output it with the cat command. It's like /dev/random but a lot faster.
Creating 8-digit Password with /dev/urandom
We can use urandom to create a relatively strong password that is not found in dictionaries. Suppose an 8-character-long password is required which should be a mix of lower- and upper-case letters, numbers and punctuations. Here's a command that uses /dev/urandom to generate a 8-character-long password.
cat /dev/urandom | tr -dc 'a-zA-Z0-9!@#%$' | head -c 8; echo
This command creates an 8-digit password made of letters randomly chosen from a set of alphabet, numbers, and special characters (! @ # % $). I think 8 digit is a reasonable length, but you can increase it to longer digits, for example, 16 digits, by using the "head -c" command. If you are not satisfied with the first result, run the command again and you'll get another random result.