列出所有enabled, active的service:systemctl list-units --type=service
列出所有service,不論active還是inactive又或者是failed和not-found:systemctl list-units --type=service --all
列出所有已安裝的service,不論有沒有運行,不論有沒有設置爲系統啓動項,不論服務是否還有效:systemctl list-unit-files --type=service
備註:
一般安裝的service file可能會有4中狀態:
- enabled 安裝了的,並會隨系統啓動而啓動。
- static Enabled服務啓動時需要同時啓動的依賴服務。
- disabled 已安裝,但不可隨系統啓動而同時啓動的服務。
- invalid 無效的