macOS Password Generator in BASH

Because feeble passwords are weak.

Official Bash Logo: http://j.mp/bash-logo

I love strong passwords. TIL an easy way to create a strong, secure password and have it copied to your clipboard.

Install pwgen (use Homebrew)

$ brew install pwgen

Add the following to your ~/.bash_profile

genpasswd() { pwgen -Bs $1 1 |pbcopy |pbpaste; echo “Has been copied to clipboard”
}

Reload your profile

$ source ~/.bash_profile

Run it

$ genpasswd 20
Eq7ZqEuiyHxscL
Has been copied to clipboard
Not on OS X? Try g20: $ npm i -g g20

Thank you for reading. If you❤️ this, click the 👏 below.

Like what you read? Give Justin Dorfman a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.