CentOS7系統經常使用命令

 

查看全部網卡IP地址——ip addride

 

啓動防火牆——systemctl start firewalld.servicepost

 

中止防火牆——systemctl stop firewalld.servicespa

 

禁止防火牆開機啓動——systemctl disable firewalld.servicerest

 

列出正在運行的服務狀態——systemctlcode

 

啓動一個服務——systemctl start postfix.serviceip

 

關閉一個服務——systemctl stop postfix.serviceget

 

重啓一個服務:——systemctl restart postfix.serviceit

 

顯示一個服務的狀態——systemctl status postfix.serviceclass

 

在開機時啓用一個服務——systemctl enable postfix.servicefile

 

在開機時禁用一個服務——systemctl disable postfix.service

 

查看服務是否開機啓動——systemctl is-enabled postfix.service;echo $?

 

查看已啓動的服務列表——systemctl list-unit-files|grep enabled

 

設置系統默認啓動運行級別3——ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

 

設置系統默認啓動運行級別5——ln -sf/lib/systemd/system/graphical.target/etc/systemd/system/default.target

相關文章
相關標籤/搜索