Yaroslav Polyakov
Posted on January 12, 2023
# 10 character random string from specified alphabet
< /dev/urandom tr -dc '[:graph:]' | head -c10; echo
Bash allows redirections at any part of command, so < file command args
above is same as command args < file
.
Examples:
KrvJz?TgbO
T[7/9Lg9L9
bp[je2Og*l
93:m_Ss$z5
C}Z=-Nj-mn
mG<85C>!i~
%>7/]AWpMd
If you do not want so many special characters, you may use something like: '[:alnum:]_$#%-'
JCPHawXEvr
orq#0S7cUk
82H7g_cHtY
um-#ACmny4
dYQFqGsX_d
💖 💪 🙅 🚩
Yaroslav Polyakov
Posted on January 12, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.