Init Command
What is the Init Command?
The init command is a vital part of Linux systems. It is the first process started by the kernel during boot and controls the system's runlevels, which define the system's state and which services should be running.
How Does It Work?
When the system boots up, init determines the system's state and launches the appropriate processes. Each runlevel corresponds to a specific system state, such as single-user mode, multi-user mode, or rebooting.
Syntax:
init [runlevel]
Common Runlevels
The init command accepts several runlevels. Each runlevel represents a different system state:
- 0: Halt the system.
- 1: Single-user mode (used for maintenance).
- 3: Multi-user mode without GUI (text-only interface).
- 5: Multi-user mode with GUI (Graphical Desktop Environment).
- 6: Reboot the system.
Examples of Using the Init Command
Here are some practical examples of how to use the init command:
To switch to runlevel 3 (multi-user mode without GUI):
$ init 3
To reboot the system:
$ init 6
Visual Example
Learn more about runlevels Runlevels are predefined system states, allowing for quick changes in system configurations. below: