正确的关机方法
Linux关机时大概需要注意一下几点:
- 查看系统使用状态多次
- 通知在线用户关机时间
- 将数据同步写入硬盘
- 关机或重启操作
关机时常用命令
- who : #查看当前谁在线
- netstat -a : #查看网络的联机状态
- sync : #将数据同步写入硬盘(建议系统关机和重启前多执行几次)
- su - : #进入root权限
- shutdown : #关机重启
- shutdown -h now : #立刻关机
- shutdown -h +10 : #10分钟后自动关机
- shutdown -h 20:00 : #20:00关机
- shutdown -r now : #立刻重启
- shutdown -r +10 : #10分钟后重启
- shutdown -r +10 ‘The system will reboot’ : #系统10分钟后重启,并将The system will reboot 信息提供给所有在线的使用者
- shutdown -k now ‘The system will reboot’ : #-k 表示警告,系统不会关机
- reboot : #系统重启
- poweroff : #系统关机
- halt : #系统停止