CentOS7 的常见指令#
系统指令#
-
查询运行级别:
runlevel
关于运行指令级别的知识点:
0:关机 1:单用户文本模式(密码恢复) 2: 3:多用户文本模式 4: 5:多用户图形模式 6:重启
-
切换运行级别:
init
-
清屏指令:
clear
网络指令#
-
查看本机 ip:
ip addr
-
测试网络连通性:
ping
服务指令#
systemctl
:管理服务
systemctl 服务名 status
:查看服务状态
systemctl 服务名 stop
:关闭服务
systemctl 服务名 start
:开启服务
systemctl 服务名 restart
:重启服务
systemctl 服务名 enable
:开机自启动服务
systemctl 服务名 disable
:关闭服务开机自启动
getenforce
:查询 selinux 的状态
setenforce
:设置 selinux 状态
其它指令#
echo
:打印消息
tar -z