Linux的一些基本操作(二)
一:查看正在运行的服务的状态
输入 systemctl list-unit-files --type service
二:安装yum源中的一些软件
先查看yum源是否完整 yum repolist 下述情况则为安全可靠的源
yum install -y 名称* -y
开启服务则 systemctl start 名称 关闭则 systemctl stop 名称
如果要设为开机启动则 systemctl enable 名称(此时可以用Tab键补全诸如systemctl start http补全为systemctl start httpd.service)
比如:systemctl enable httpd
禁止启动则 syestemctl mask 名称
解除禁止则 systemctl unmask 名称
三:关机命令
输入 init 0或者systemctl isolate runlevel0.target
下次开机启动将以此等级运行 systemctl set-default runlevel6.target