init Linux Command

How to use init command in Linux?

Explanation

init COMMAND:

"init" is the parent of all the computer processes and it gets started in the booting of the system. It runs as a backend process of the computer programming and creates the processing from the script that is stored in the file /etc/inittab. This command can be used to start with a specified mode, stop or restart the server or machine.

SYNTAX :


init <runlevel>

Runlevels


Runlevels assess the state of the machine. Its a software processing that permit only the selected group of files to exist. There are eight important run levels. Let all the description for run levels start as Caps or Small.
OptionsDescription
0stops the system
1Single user mode
2Multiuser, without NFS
(The same as 3, if you do not have networking)
3Full multiuser mode
4unused
5X11
6Reboot the system
7-9Valid script
SIts is used when the script is entering run level 1.

Example

init 6

Above example is used to restart the system.
Behind each child termination, init records the fact and the reason it died in /var/run/utmp and /var/log/wtmp.

Ask Questions

Ask Question