【运维知识基础篇】Linux系统基础命令:关机、重启命令
平时使用的话,关机和重启的命令,各记住一个就ok了,看个人喜欢了哈
一、关机命令
1、shutdown ----关机
shutdown ----默认1分钟后关闭系统;
shutdown -h 5 ----表示5分钟后关闭操作系统;
shutdown -h now ----表示 立刻关闭操作系统;
shutdown -c ----取消关机或重启;
[root@localhost ~]# #按回车 默认1分钟后关闭操作系统
[root@localhost ~]# shutdown
[root@localhost ~]# #表示立即关闭操作系统
[root@localhost ~]# shutdown -h now
[root@localhost ~]# #表示5分钟后关闭操作系统
[root@localhost ~]# shutdown -h 5
Shutdown scheduled for 二 2024-04-30 19:57:06 CST, use 'shutdown -c' to cancel.
[root@localhost ~]# #取消关机或重启
[root@localhost ~]# shutdown -c
Broadcast message from root@localhost.localdomain (Tue 2024-04-30 19:52:29 CST):
The system shutdown has been cancelled at Tue 2024-04-30 19:53:29 CST!
2、poweroff ----直接关机
[root@localhost ~]# poweroff #按回车 直接关机
3、init 0 ----直接关机
[root@localhost ~]# init 0 #按回车 直接关机了
二、重启命令
1、shutdown -r ----重启
shutdown -r --默认1分钟后重启
shutdown -r 5 ----表示5分钟后重启
shutdown -r now ----表示立刻重启
[root@localhost ~]# #1分钟后重启
[root@localhost ~]# shutdown -r
[root@localhost ~]# #5分钟后重启
[root@localhost ~]# shutdown -r 5
[root@localhost ~]# #立刻重启
[root@localhost ~]# shutdown -r now
2、reboot ----直接重启
[root@localhost ~]# reboot #按回车直接重启
3、init 6 ----直接重启
[root@localhost ~]# init 6 #按回车直接重启
============================================
【微语】
我们无法预知未来是什么样子,但却可以通过把握现在去塑造未来。珍惜今天的每分每秒,读书、学习、运动,让自己变得更好。只有抓住当下,充实自己,才能站稳脚跟,拥抱未来。