–=使用/dev/random产生随即数字串或字符串===
产生随机的小写字母串 [root@nezhdb01 tmp]# head -c 100 /dev/urandom | tr -dc ‘a-z’ |cut -c 1-10 ekmuenluwt [root@nezhdb01 tmp]# head -c 100 /dev/urandom | tr -dc ‘a-z’ |cut -c 1-10 lbydekyufy [root@nezhdb01 tmp]# head -c 100 /dev/urandom | tr -dc ‘a-z’ |cut -c 1-10 nmzwjlstte [root@nezhdb01 tmp]# head -c 100 /dev/urandom | tr -dc ‘a-z’ |cut -c 1-10 bspvvsiyks
产生随机的大写字母串 [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Z’ |cut -c 1-10 EODLNKUNON [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Z’ |cut -c 1-10 IJKZPUITVS [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Z’ |cut -c 1-10 VKTHRAKMSI [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Z’ |cut -c 1-10 EETXSZLQLD
产生大小写字母混合串 [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Za-z’ |cut -c 1-10 qMKOlKNKCq [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Za-z’ |cut -c 1-10 fJmwacprTi [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Za-z’ |cut -c 1-10 ZpzspsSxaD [root@nezhdb01 tmp]# head -c 200 /dev/urandom | tr -dc ‘A-Za-z’ |cut -c 1-10 CvDgCSxYit
产生数字串 [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9’ |cut -c 1-10 3555282542 [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9’ |cut -c 1-10 4030826183 [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9’ |cut -c 1-10 3650151046 [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9’ |cut -c 1-10 4672539803
数字、字母、特殊字符混合串 [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9a-zA-Z!~@#$%^&’ |cut -c 1-10 aVB7A%I2hq [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc '0-9a-zA-Z!~@#$%^&’ |cut -c 1-10 VVz&7HVcwZ [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9a-zA-Z!~@#$%^&’ |cut -c 1-10 y#51kYRM6P [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc '0-9a-zA-Z!~@#$%^&’ |cut -c 1-10 bYzyPVSCj$ [root@nezhdb01 tmp]# head -c 500 /dev/urandom | tr -dc ‘0-9a-zA-Z!~@#$%^&*’ |cut -c 1-10 ~t%nmK27lK