cat /dev/urandom | sed 's/[^a-zA-Z0-9]//g' | strings -n C | head -n L
其中C表示字符串的字符数,L表示要生成多少行字符。
[root@localhost sqlite3]# cat /dev/urandom | sed 's/[^a-zA-Z0-9]//g' |strings -n 5|head -n 1
oMcFO