linux关机命令是什么(linux关机命令的特点与区别)

linux关机命令是什么(linux关机命令的特点与区别)

linux的关机命令有shutdown、halt、poweroff、init, 每个人习惯用的可能都不同,有些人是充分了解然后选了一个常用,有些人是入门的时候别人教的是哪个就常用哪个了。

shutdown

shutdown [options] [time] [message]

shutdown -h now 立刻关机

shutdown -h +5 “大家好,服务器将在5分钟后关机”

所有登录服务器的用户都会收到消息,且关机前5分钟禁止登录。

shutdown -c 取消关机

网上有一种说法,说shutdown是一个安全命令,且在早期的 Linux 系统中,只有 shutdown 命令在关机或重启之前会正确地中止进程及服务,认为 shutdown 才是最安全的关机与重启命令。

halt
halt [options]
halt -p 为关机
halt -d 为关机,不留记录

poweroff
poweroff [options]
poweroff 为关机
poweroff -f 强制关机

init
init [options]
init 0 为关机
init 6 重新启动,等于reboot

以上是 linux关机命令是什么(linux关机命令的特点与区别) 的全部内容, 来源链接: www.tmjl8.com/smart/441325.html

回到顶部