CentOS7查看自啟列表命令
systemctl list-unit-files
執行結果:"enabled:自啟動","disabled:未自啟動"
只查看服務類型的開機啟動
systemctl --type service list-unit-files
重啟或者查看某個服務狀態
systemctl restart abrtd.service
systemctl status abrtd.service
設置服務開機啟動
systemctl enable nginx.service //設置nginx開機啟動
systemctl enable php-fpm.service //php-fpm開機啟動
搜索指定狀態的服務
systemctl list-unit-files | grep enabled //搜索全部已啟動的服務,enabled 啟用;disabled 禁用。
搜索指定服務的狀態
systemctl list-unit-files | grep nginx //搜索 nginx 的開機啟動狀態