BASH - generate random string
1 | cat /dev/urandom | tr -dc '[:alpha:]' | fold -w ${1:-20} | head -n 1 |
1 | cat /dev/urandom | tr -dc '[:alpha:][:punct:]' | fold -w ${1:-20} | head -n 1 |
Classes:
Class | Description |
---|---|
alnum | Alphanumeric characters |
alnum | Alphanumeric characters |
alpha | Alphabetic characters |
blank | White space characters |
cntrl | Control characters |
digit | Numeric characters |
graph | Graphic characters |
ideogram | Ideographic characters |
lower | Lowercase alphabetic characters |
phonogram | Phonographic characters |
Printable characters | |
punct | Punctuation characters |
rune | Valid characters |
space | Space characters |
special | Special characters |
upper | Uppercase alphabetic characters |
xdigit | Hexadecimal characters |
Recommendations