shell经典脚本或命令行
生活随笔
收集整理的這篇文章主要介紹了
shell经典脚本或命令行
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
查看文件或目錄大小
~$du -h file_path //查看某個文件大小,并顯示易讀的單位 ~$du -ah //查看當(dāng)前目錄下及其子目錄下所有文件的大小生成自簽名證書
create-ca.sh
#!/bin/shopenssl genrsa -out ca.key 2048 && \ printf "\\n\\n\\n\\n\\n\\n\\n" | \ openssl req -config tmp.cnf -x509 -new -nodes -key ca.key -sha256 -days 1024 -out ca.pemcreate-client-cert.sh
#!/bin/shif [ -z "$1" ] ; thenecho "Usage $0 <name>"exit 1 fiopenssl genrsa -out $1.key 4096 && \ printf "\\n\\n\\n\\n\\nlocalhost\\n\\n1234\\n\\n" | \openssl req -config tmp.cnf -new -key $1.key -out $1.csr && \ openssl ca -config tmp.cnf \-keyfile ca.key \-cert ca.pem \-extensions usr_cert \-days 375 \-notext \-md sha256 \-in $1.csr \-out $1.pem && \ openssl pkcs12 -export -in $1.pem -inkey $1.key -out $1.p12create-server.sh
#!/bin/shif [ -z "$1" ] ; thenecho "Usage $0 <name>"exit 1 fiopenssl genrsa -out $1.key 4096 && \ printf "\\n\\n\\n\\n\\nlocalhost\\n\\n1234\\n\\n" | \openssl req -config tmp.cnf -new -key $1.key -out $1.csr && \ openssl ca -config tmp.cnf \-keyfile ca.key \-cert ca.pem \-extensions server_cert \-days 375 \-notext \-md sha256 \-in $1.csr \-out $1.pem啟動docker容器
echo "12345" | sudo -S docker start [id] && sudo docker exec-it [id] /bin/bash總結(jié)
以上是生活随笔為你收集整理的shell经典脚本或命令行的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 查询进程并杀死该进程
- 下一篇: 代码覆盖率命令行