查看当前系统中的登录用户, 当前网络连接信息, 当前系统的进程状态。
1、首先调用who命令,查看当前登录用户。
[root@centos6basicser ~]# who

2、使用netstat命令,查看当前网络连接信息。
[root@centos6basicser ~]# netstat -tpln

3、使用ps命令,显示当前系统的进程状态。
[root@centos6basicser ~]# ps -aux

1、shutdown -k,向所有登录用户发出警告信息(仅做提示信息),将在预定时间,或预定时间段内(30分钟)关机,但不会实际关机。
[root@centos6basicser ~]# shutdown -k 22:11 'The System will shutdown at 22:11 tonight, Please save your data as soon as possible.'

[root@centos6basicser ~]# shutdown -k +30 'The System will shutdown in 30 mins, Please save your data as soon as possible.'

1、sync命令,建议多次执行,保证数据安全。
- [root@centos6basicser ~]# sync
- [root@centos6basicser ~]# sync
- [root@centos6basicser ~]# sync

shutdown命令,是一种安全的方式关闭系统,所有登陆用户都可以看到关机信息提示,并且登录将被阻塞,也就是新的用户不能再登录。
shutdown命令,可以直接关机,或是延时关机,同样可以进行重启系统。
不推荐使用其他关机或重启命令,比如:poweroff、reboot、halt、init。
1、shutdown -h ,预定时间关机,或预定时间段内(30分钟)关机,并向所有登录用户发出警告信息。
- [root@centos6basicser ~]# shutdown -h 22:11 'The System will shutdown at 22:11 tonight, Please save your data as soon as possible.'
-
- [root@centos6basicser ~]# shutdown -h +30 'The System will shutdown in 30 mins, Please save your data as soon as possible.'
2、shutdown -h now,现在立即关机
[root@centos6basicser ~]# shutdown -h now
3、shutdown -r,预定时间重启,或预定时间段内(30分钟)重启,并向所有登录用户发出警告信息。
- [root@centos6basicser ~]# shutdown -r 22:11 'The System will reboot at 22:11 tonight, Please save your data as soon as possible.'
-
- [root@centos6basicser ~]# shutdown -r +30 'The System will reboot in 30 mins, Please save your data as soon as possible.'
4、shutdown -r now,现在立即重启
[root@centos6basicser ~]# shutdown -r now