by Devin Yang

建立於: 8年前 ( 更新: 8年前 )

在Linux的~/.bashrc或是MacOS上的~/.bash

在終端機上測試(貼到終端機上執行即可):
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
如果您使用的shell是bash,可以把他加入./bash_profile中如下:
alias gpw='genpasswd'
genpasswd() {
env LC_CTYPE=C tr -dc A-Za-z0-9_ < /dev/urandom | head -c "16" | xargs
}
記得更新一次 source ~/.bash_profile 生效。
然後我們只要輸入gpw就能夠,產生一組隨機的密碼囉。
password-generator

Tags: linux mac

Devin Yang

文章內容無法一一說明,如果您有什麼不了解處,歡迎提問哦:)

No Comment

Post your comment

需要登入才可留言!

類似的文章


linux

無密碼詢問,產生ssh金鑰對

有時進行自動設定時,需要產生ssh的金鑰對。 命令列無密碼詢問,產生ssh金鑰對。

Emoji, MacOS

⌘+control+空白 (Emoji on Mac)

⌘+control+空白 (Emoji on Mac)

cli,linux,macos

如何用find刪除建立時間為準的舊檔案

這功能很好用,但要很小心,先看再刪,弄錯目錄會死很慘&nbsp;