当前位置: 移动技术网 > 科技>操作系统>Linux > Linux中使用init命令关机、重启、切换模式等

Linux中使用init命令关机、重启、切换模式等

2018年11月08日  | 移动技术网科技  | 我要评论
这篇文章主要介绍了Linux中使用init命令关机、重启、切换模式等,init 0是最快捷的关机方式了,在无关紧要的环境中可以使用此命令快速关机,需要的朋友可以参考下... 15-05-20

正在学习linux中。。。一边学一边记录着。。所有观点只是个人观点
linux有个文件   /etc/inittab


复制代码
代码如下:

#
# inittab this file describes how the init process should set up
# the system in a certain run-level.
#
# author: miquel van smoorenburg, <miquels@drinkel.nl.mugnet.org>
# modified for rhs linux by marc ewing and donnie barnes
#</p> <p># default runlevel. the runlevels used by rhs are:
# 0 - halt (do not set initdefault to this)
# 1 - single user mode
# 2 - multiuser, without nfs (the same as 3, if you do not have networking)
# 3 - full multiuser mode
# 4 - unused
# 5 - x11
# 6 - reboot (do not set initdefault to this)
#
id:3:initdefault:


0是关机
1是单用户
2是多用户,不联网
3是多用户
4是不使用的
5是xwindows,也就是有界面的
6是重启

init命令很简单。直接输入init + 你想要的模式  回车就行。
比如 输入  :  init 0   就是关机
init 3  就是切换到多用户
init 5  就是切换到界面
init 6  就是重启

我实验的时候都是在root用户下进行的,不知道其它用户可不可以,再实验实验。

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网