Created
April 25, 2018 21:11
-
-
Save jakebathman/dc25166408b8c0e1218978c625adbf93 to your computer and use it in GitHub Desktop.
Random string generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use these on the command line to generate random strings | |
# Tested in CentOS and macOS | |
# All printable characters | |
head /dev/urandom | LC_CTYPE=C tr -dc "[:print:]" | head -c 32 | |
# Only A-Za-z0-9 | |
head /dev/urandom | LC_CTYPE=C tr -dc "A-Za-z0-9" | head -c 32 | |
# Alphanum with some special characters | |
head /dev/urandom | LC_CTYPE=C tr -dc 'A-Za-z0-9%^&*()\-=_+' | head -c 32 | |
# Numbers only | |
head /dev/urandom | LC_CTYPE=C tr -dc 0-9 | head -c 32 | |
# Letters only | |
head /dev/urandom | LC_CTYPE=C tr -dc A-Za-z | head -c 32 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment