使用一系列命令生成字母数字符号组合

随机生成10位数字:
date +%N%N | cut -c '1-10'
uuidgen | tr 'a-z-' '0-9' | cut -c 1-10
随机生成10位字母:
date +%N%N | cut -c 1-10 | tr '0-9' 'a-z'
uuidgen | tr '0-9-' 'a-z' | cut -c 1-10
openssl rand -hex 10 | tr '0-9' 'a-z' | cut -c 1-10
cat /dev/urandom | tr -dc "a-zA-Z" | fold -w 10 | head -1 (随机生成10位大小字母)
随机生成10位字母+数字的混合:
uuidgen | tr -d '-' | cut -c 1-10
cat /dev/urandom | head -n 10 | md5sum | cut -c 1-10
openssl rand -hex 10 | tail -c 11
随机生成10位字母+数字的混合+特殊符号:
cat /dev/urandom | tr -dc "a-zA-Z0-9_+~!@#$\%^&*()\/\`-\_=+-"| fold -w 10 | head -1

原文地址:https://www.cnblogs.com/lyqlyqlyq/p/11641683.html