linux关机重启命令

来源:互联网 发布:python执行exe程序 编辑:程序博客网 时间:2024/05/23 02:06

1.shutdown

-c 取消前一个关机命令(-c   cancel a running shutdown)

-h 关机 (-h   halt or power off after shutdown )

-r 重启( -r   reboot after shutdown )

[root@localhost ~]# shutdown -h now

2.其他关机命令

[root@localhost ~]# halt

[root@localhost ~]# poweroff

[root@localhost ~]# init0

3.其他重启命令

[root@localhost ~]# reboot
[root@localhost ~]# init 6

4.系统运行级别

0 关机(halt)

1 单用户(Single user mode)

2 不完全多用户,不含NFS服务(不包含NFS服务的命令行)(Multiuser, without NFS (The same as 3, if you do not have networking))

3 完全多用户(完全的命令行)(Full multiuser mode)

4 未分配( unused)

5 图形界面(X11)

6 重启( reboot )

修改系统默认运行级别

[root@localhost ~]# cat /etc/inittab

id:5:initdefault:

查询系统运行级别

[root@localhost ~]# runlevel
N 5

5.退出登录命令

[root@localhost ~]# exit

[root@localhost ~]# logout