Published - 7 years ago ( Updated - 7 years ago )
~/.bashrc on Linux or ~/.bash on MacOS
Test on the terminal (just paste it on the terminal and execute it):
Test on the terminal (just paste it on the terminal and execute it):
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
If the shell you use is bash, you can add it to ./bash_profile as follows:
alias gpw='genpasswd'
genpasswd() {
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
}
Remember to update source ~/.bash_profile take effect.
Then we only need to enter gpw to generate a set of random passwords.
livewire/content-tags
Tags:
linux
mac
Devin Yang
Feel free to ask me, if you don't get it.:)
Follow
livewire/comments
No Comment
Post your comment
Login is required to leave comments