Nov. 17, 2021 1 min read

Generating Random Strings on Linux in One Line️

With following command you can print a random string of a certain length on Linux.

tr -dc A-Za-z0-9 </dev/urandom | head -c 32 ; echo ''

The string is safe to use in most web contexts such as HTML forms or environment variables.