Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use init command in Linux to shut down, restart, switch mode, etc.

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces the relevant knowledge of "how to use the init command in Linux to shut down, restart, switch mode, etc.". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Linux has a file / etc/inittab

The code is as follows:

#

# inittab This file describes how the INIT process should set up

# the system in a certain run-level.

#

# Author: Miquel van Smoorenburg

# Modified for RHS Linux by Marc Ewing and Donnie Barnes

#

# 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 is the shutdown

1 is a single user

2 is multi-user and does not connect to the Internet.

3 is multi-user

4 is not used

5 is xwindows, that is, with an interface.

6 is reboot

The init command is simple. Just enter init + the mode you want and enter.

For example, enter "init 0" to shut down the computer.

Init 3 is to switch to multi-user.

Init 5 is to switch to the interface.

Init 6 is a restart.

When I experiment, I do it under root users. I don't know if other users can do it.

This is the end of the content of "how to use init commands in Linux to shut down, restart, switch mode, etc.". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report