The reboot command is a command-line utility that is used to reboot the system in Linux and other Unix-like operating systems. It is usually found in the init system folder (such as /sbin/reboot or /usr/sbin/reboot).
To use the reboot command, open a terminal and type reboot followed by any necessary options. For example:
- reboot: Immediately reboots the system.
- reboot -h: Immediately reboots the system and halts it after shutdown.
- reboot -r: Immediately reboots the system and performs a system shutdown before rebooting.
Note: It is generally a good idea to save any open documents and close all programs before rebooting the system to avoid data loss.
Here are some additional options that you can use with the reboot command:
- -d: Delays the reboot by the specified number of seconds.
-f: Forces a reboot, even if the system is not responding. - -n: Skips the system shutdown and goes straight to the reboot.
- -w: Prints a warning message to all logged-in users before rebooting.
For a full list of options, you can type man reboot to view the manual page for the reboot command.
reboot Command Examples
1. Reboot the system:
# reboot
2. Power off the system (same as `poweroff`):
# reboot --poweroff
3. Halt the system (same as `halt`):
# reboot --halt
4. Reboot immediately without contacting the system manager:
# reboot --force
5. Write the wtmp shutdown entry without rebooting the system:
# reboot --wtmp-only