Linux Init Command Guide

In Linux, the “init” command is used to switch the system’s runlevel. Runlevel refers to the mode or state in which the system is running, with each runlevel corresponding to different services and functions.

The basic format for using the “init” command is as follows:

init [runlevel]

Runlevel refers to the system operating level to switch to. Commonly used runlevels include 0 (shutdown), 1 (single-user mode), 2 (multi-user mode without NFS services), 3 (full multi-user mode), 4 (reserved), 5 (graphical user interface mode), and 6 (restart).

For example, to switch the system to multi-user mode (runlevel 3), you can use the following command:

init 3

Please note that the “init” command has been replaced by systemd in modern Linux systems, so it is not recommended to directly use the “init” command to switch system runlevels. A better approach is to use the systemctl command to manage system services and switch runlevels.

bannerAds