1     echo $RANDOM

    echo $RANDOM | md5sum | cut -c 1-9 (截取8位)


2    openssl rand -base64 8

    openssl rand -base64 8 | md5sum | cut -c 1-9


3    date +%N%t

    echo "$(date +%N%t)"


4    mkpasswd -l 8

    mkpasswd -l 8 | md5sum (需 rpm -qa expect)


5    head /dev/urandom | cksum


6    cat /proc/sys/kernel/random/uuid

    cat /proc/sys/kernel/random/uuid | md5sum | cut -c 1-9


将随机数排序且去重    


echo $RANDOM | md5sum | cut -c 1-9 | sort | uniq -c | sort -nk1 (最前面数字为1即惟一)


20个:

 for n in `seq 20`;do echo $RANDOM |md5sum|cut -c 1-9|sort|uniq -c|sort -nk1;done