系统相关
首页 > 系统相关> > shell生成随机长短数字串或是字符串

shell生成随机长短数字串或是字符串

作者:互联网

长度为32位

[root@harbor ~]# echo $RANDOM | sha256sum | base64 | head -c 32; echo
MTY1YTAxYzNmMGFmMmI5ZGEyYTMxNzk2
[root@harbor ~]# tr -cd "1-39" < /dev/urandom | head -c 32
93211212323391391213232112222212You have new mail in /var/spool/mail/root
[root@harbor ~]# 

  

标签:head,shell,数字串,harbor,32,echo,字符串,mail,root
来源: https://www.cnblogs.com/wyf-577513827/p/11428009.html