andylanzhiyong 2020-02-19
关机重启命令
shutdown [选项] 时间 -c 取消前一个关机命令 -h 关机 -r 重启
# 现在立刻关机 shutdown -h now # 定时关机 shutdown -h 20:30 # 现在立刻重启 shutdown -r now
halt poweroff init 0
reboot init 6
关机 单用户(启动最小的服务,用来做修复,类似windows安全模式) 不完全多用户,不含NFS(network file system)服务 完全多用户 未分配 图形界面 重启
cat /etc/inittab 上面的centos7 已取消运行级别,使用targets取代 [1hh0kkwoiz ~]# cat /etc/inittab # inittab is no longer used when using systemd. # # ADDING CONFIGURATION HERE WILL HAVE NO EFFECT ON YOUR SYSTEM. # # Ctrl-Alt-Delete is handled by /usr/lib/systemd/system/ctrl-alt-del.target # # systemd uses 'targets' instead of runlevels. By default, there are two main targets: # # multi-user.target: analogous to runlevel 3 # graphical.target: analogous to runlevel 5 # # To view current default target, run: # systemctl get-default # # To set a default target, run: # systemctl set-default TARGET.target # 查看运行级别 systemctl get-default [ ~]# systemctl get-default multi-user.target # multi-user.target: analogous to runlevel 3 # graphical.target: analogous to runlevel 5
退出登录