Skip to content

Basic systemd Commands

HUANG CHEN FANG edited this page Jun 29, 2017 · 3 revisions
$systemctl --help              #查詢systemctl指令用法
$systemctl list-units          #查詢目前所有啟動中的服務
$systemctl list-units -a       #查詢目前所有已啟動及未啟動的服務
$systemctl enable xxx.service  #設定開機啟動xxx.service
$systemctl disable xxx.service #設定開始不啟動xxx.service
$systemctl stop xxx.service    #立即停止xxx.service
$systemctl start xxx.service   #立即啟動xxx.service
$sytemctl status xxx.service   #查詢xxx.serivce目前的狀態

$systemctl --list-units [--type=[service|socket|path]   #依不同類型查詢啟動中的服務
$systemctl is-enabled sshd                              #查詢服務是否設定開機啟動
$systemctl is-active sshd                               #查詢服務是否正常啟動
$systemctl list-unit-files                              #查詢服務啟動或是關閉狀態,以檔名顯示

Clone this wiki locally