by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

~/.bashrc on Linux or ~/.bash on MacOS

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.
password-generator

Tags: linux mac

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux,macos

PS aux will you?

For Linux system administrators, you must understand the ps aux command. If you want to be a Linux system administrator, or you are a Linux user, you should understand this command. ps is process status For short, anyone can find out what kind of program is running on the system and how the status is executed through this command. I saw some programs that should not appear, maybe the system was hacked and used to mine🥹

linux

About setfacl

I think most of the current Linux supports Access Control List (ACL). With filesystem ACLs enabled, We can set additional permissions to different users or groups. This allows us to set the file system permissions of different users more freely. Go straight to the command.