Skip to content

Instantly share code, notes, and snippets.

@dmelo
Created June 22, 2017 02:19
Show Gist options
  • Save dmelo/90d9f088f08d034bf462f6dd72dc2234 to your computer and use it in GitHub Desktop.
Save dmelo/90d9f088f08d034bf462f6dd72dc2234 to your computer and use it in GitHub Desktop.
Generates password with random chars including lower and upper case alpha, numeric and special chars
#!/bin/bash
[[ $# -eq 1 ]] && N=$1 || N=16
cat /dev/urandom | tr -dc a-zA-Z0-9\!\@\#\$\%\^\&\*\(\)\-\+\=\'\;\: | head -c${a:-$N}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment