天天看點

CentOS7系統常用指令

檢視所有網卡IP位址——ip addr

啟動防火牆——systemctl start firewalld.service

停止防火牆——systemctl stop firewalld.service

禁止防火牆開機啟動——systemctl disable firewalld.service

列出正在運作的服務狀态——systemctl

啟動一個服務——<code>systemctl start postfix.service</code>

<code>關閉一個服務——<code>systemctl stop postfix.service</code></code>

<code>重新開機一個服務:——<code>systemctl restart postfix.service</code></code>

<code>顯示一個服務的狀态——<code>systemctl status postfix.service</code></code>

<code>在開機時啟用一個服務——<code>systemctl enable postfix.service</code></code>

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

<code>檢視服務是否開機啟動——<code>systemctl is-enabled postfix.service;echo $?</code></code>

<code>檢視已啟動的服務清單——<code>systemctl list-unit-files|grep enabled</code></code>

<code><code>設定系統預設啟動運作級别3——<code>ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target</code></code></code>

<code><code><code>設定系統預設啟動運作級别5——<code>ln -sf/lib/systemd/system/graphical.target/etc/systemd/system/default.target</code></code></code></code>

<code><code><code><code> </code></code></code></code>

<code><code><code><code>本文轉自 tianya1993 51CTO部落格,原文連結:http://blog.51cto.com/dreamlinux/1744425,如需轉載請自行聯系原作者 </code></code></code></code>

繼續閱讀