Skip to content

Instantly share code, notes, and snippets.

@thiagozs
Created September 22, 2015 17:13
Show Gist options
  • Select an option

  • Save thiagozs/6834085d271d10d3ffb4 to your computer and use it in GitHub Desktop.

Select an option

Save thiagozs/6834085d271d10d3ffb4 to your computer and use it in GitHub Desktop.
Password Generator Bash
#!/bin/bash
genpasswd() {
local l=$1
[ "$l" == "" ] && l=16
tr -dc A-Za-z0-9_ < /dev/urandom | head -c ${l} | xargs
}
genpasswd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment