Linux小技巧:生成随机字符串(转)

生成全字符随机的字串:
cat /dev/urandom | strings -n C | head -n L

生成数字加字母的随机字串:
cat /dev/urandom | sed ’s/[^a-zA-Z0-9]//g’ | strings -n C | head -n L

其中C表示字符串的字符数,L表示要生成多少行字符。
winger


Source: http://blog.sina.com.cn/s/blog_54229ea6010096g4.html

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*


为了防止恶意的垃圾评论脚本,请输入以下图片里面的数学方程式的答案。
防垃圾评论问题