// 查看狀態
$ sudo systemctl status nginx.service
// 開啓 nginx 服務
$ sudo systemctl start nginx.service
// 重啓服務
$ sudo systemctl restart nginx.service
// 查看所有服務
$ sudo systemctl list-units --type=service
// 查看狀態
$ sudo systemctl status nginx.service
// 開啓 nginx 服務
$ sudo systemctl start nginx.service
// 重啓服務
$ sudo systemctl restart nginx.service
// 查看所有服務
$ sudo systemctl list-units --type=service
shell腳本獲取腳本所在目錄 執行腳本的父目錄不一定是當前的工作目錄。 url=$(dirname $(readlink -f $0))