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.
Options | Description |
0 | stops the system |
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 the system |
7-9 | Valid script |
S | Its 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.