In Linux, the init 6 command gracefully reboots the system running all the K* shutdown scripts first, before rebooting. The reboot command does a very quick reboot. It doesn’t execute any kill scripts, but just unmounts filesystems and restarts the system. The reboot command is more forceful.
What does init do in Linux?
Init is the parent of all processes, executed by the kernel during the booting of a system. Its principle role is to create processes from a script stored in the file /etc/inittab. It usually has entries which cause init to spawn gettys on each line that users can log in.
How use init command in Linux?
Run Level Commands:
- Shutdown: init 0. shutdown -h now. -a: Use file /etc/shutdown.allow. -c: Cancel scheduled shutdown. halt -p. -p: Turn power off after shutdown. poweroff.
- Reboot: init 6. shutdown -r now. reboot.
- Enter single user mode: init 1.
- Check current runlevel: runlevel.