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, centos, rsnapshot

如何在CentOS 7安裝rsnapshot

rsnapshot是一個採用rsync為基礎的工具,他可以進行快照式的增量備份,不過我們在CentOS下了which rsnapshot怎麼沒有這個指令呢,用yum install rsnapshot沒有辨法安裝?

cli,linux,macos

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

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

Emoji, MacOS

⌘+control+空白 (Emoji on Mac)

⌘+control+空白 (Emoji on Mac)