雖然linux的命令很多都是相同的,但是新版的centos 7 上面與以前的有些命令還是有所不同,不過還好,有提示。所以就在百度上面搜尋了以下,作為記載,以後方便查看:
centos7 上面啟動服務以及關閉服務已經不是以前的service stop/start xxxx了而是systemctl命令,不過用service他會有一個提醒你用systemctl,所以大可不必擔心。
看所有網卡IP地址——ip addr
啟動防火牆——systemctl start firewalld.service
停止防火牆——systemctl stop firewalld.service
查看firewalld防火牆狀態——firewall-cmd --state
禁止防火牆開機啟動——systemctl disable firewalld.service
列出正在啟動並執行服務狀態——systemctl
啟動一個服務——systemctl start postfix.service
關閉一個服務——systemctl stop postfix.service
重啟一個服務:——systemctl restart postfix.service
顯示一個服務的狀態——systemctl status postfix.service
在開機時啟用一個服務——systemctl enable postfix.service
在開機時禁用一個服務——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
原文地址:http://www.centoscn.com/CentOS/help/2015/0618/5687.html