by Devin Yang
(This article was automatically translated.)

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):
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


macos

About ditto instructions on MacOS

The ditto command appeared in Mac OS X (10.0) for the first time. In some cases, it is more intuitive than the cp command. Those who are interested can study and test it by themselves. Assuming that there is an envs folder in my directory, my test is as follows:

linux,system

Detect whether selinux is enabled in the system

Detect whether selinux is enabled in the system

php,linux

WebShell Function Introduction and Precautions

I suddenly wanted to introduce what is WebShell, so I found one on the Internet. Its functions are quite good. But I still wanted some features, so I spent three nights making some small optimizations for him. If you haven't heard of WebShell yet, take a look at this video. If you like my optimized version, please give me a like, thank you.