CHARS='a-zA-Z0-9'; LENGTH='32'; COUNT='5'; tr -dc $CHARS < /dev/urandom | fold -w $LENGTH | head -n $COUNT
Where $CHARS is the set of allowed characters, $LENGTH is the number of characters for the passwords and $COUNT is the number of passwords to generate. For better random values use /dev/random, but it might be slower when the system’s entropy is low.