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

如何檢查apache載入並啟用了那些modules?

如何檢查apache載入並啟用了那些modules?

linux, python, colab

如何從我們的Server透過ssh連線到colab?

介紹我寫的一支bash,用來透過ssh連線到colab vm內。 一行指令,搞定colab OpenSSH Server。

linux, centos, rsnapshot

如何在CentOS 7安裝rsnapshot

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