This tutorial explains Linux “reboot” command, options and its usage with examples.
Synopsis :
reboot [-n] [-w] [-d] [-f] [-i]
OPTIONS:
-n
Prevent the sync before reboot or halt.
-w
Don’t actually reboot or halt but only write the wtmp record (in the /var/log/wtmp file).
-d
Don’t write the wtmp record. The -n flag implies -d.
-f
Force halt or reboot, don’t call shutdown.
-i
Shut down all network interfaces just before halt or reboot.
If reboot is called when the system is not in runlevel 6, in other words when it’s running normally, shutdown will be invoked instead (with the -r flag).
Hence immediate reboot can also be used as
$ shutdown -r now
Once system processes have been killed and filesystems have been unmounted, the system reboots automatically. This is done using the reboot command, which syncs changes to disks and then performs the actual reboot.
On Linux, if reboot is run when the system has not already started the shutdown process, it will invoke the shutdown command automatically rather than directly performing its intended action. However, on systems such as FreeBSD, these commands first log the action in wtmp and then will immediately perform the halt/reboot themselves, without first killing processes or unmounting filesystems.
For example :
$ reboot
This is an immediate reboot.
OR
To reboot it with a custom, 30 minute advance warning:
$ shutdown -r +30 "Planned Reboot"
Sanfoundry Global Education & Learning Series – 1000 Linux Tutorials.
- Practice Programming MCQs
- Check Linux Books
- Check Information Technology Books
- Apply for Programming Internship