FUNDAMENTALS A Complete Guide for Beginners
The reboot command in Linux is a helpful tool for rebooting your whole system. While installing a new package or making major changes in your system, sometimes it is necessary to reboot your whole system. In such circumstances, the reboot command in Linux comes to excellent service.
A. Description
Using the reboot command in Linux, any user can restart the whole system from the command line.
B. Syntax
The reboot command in Linux takes OPTION. The syntax for the reboot command is given below.
reboot [OPTIONS...]
C. Options
Different options can be added to the syntax of the reboot command to modify the command. Here, I have listed some valuable options below. Nevertheless, If you do not find your desired options here, you can look for them on the man (manual) page. To go to the man page, type the following command and press ENTER.
man reboot
Useful Options
- -d/–no-wtmp: It does not write wtmp record during reboot.
- –help: It prints a short help text and then exits.
- -f/–force: It forcefully reboots the system.
- –no-wall: It does not send any wall message during reboot.
- -p/–poweroff: Power off the machine.
Practical Examples of the “reboot” Command in Linux
You can reboot the whole system from the command line using the reboot command in Linux. Some practical example of the reboot command has been illustrated below.
Example 1: Restart Your System Using the “reboot” Command in Linux
You can easily restart your system using the reboot command. Here, I will reboot my system. To do so, follow the below procedures.
Steps to Follow >
➊ At first, open the Ubuntu Terminal.
➋ Then, type the following command in the command prompt:
sudo reboot
➌ Now, press the ENTER button.
Output >
The following image shows that the reboot command has rebooted my system.
Example 2: Restart Your System Using the “reboot” Command and “systemctl” Command in Linux
In this example, I will reboot my system using the systemctl command along with the reboot command. To achieve so, follow the below procedures.
Steps to Follow >
➊ At first, open the Ubuntu Terminal.
➋ Then, type the following command in the terminal.
sudo systemctl reboot
➌ Now, press the ENTER button.
Output >
I have rebooted my system with the systemctl command along with the reboot command, as shown in the below image.
Example 3: Printing the Help Section of the “reboot” Command in Linux
You can easily print the help section containing specific options for the reboot command. Here, I will print the help section of the reboot command. To achieve the same, follow the steps given below.
Steps to Follow >
➊ At first, open the Ubuntu Terminal.
➋ Type the following command in the command prompt:
reboot --help
➌ Now, press the ENTER button.
Output >
The following image shows that the help section of the reboot command is displayed in the terminal.
Conclusion
In this article, I have demonstrated the process of rebooting the system using the reboot command in Linux. Therefore, I hope your productivity will increase with the help of these practical examples.
Similar Readings
- The “sudo” Command in Linux [8 Practical Examples]
- The “apt” Command in Linux [13+ Practical Examples]
- The “install” Command in Linux [6+ Practical Examples]
- The “service” Command in Linux [6 Practical Examples]
- The “uname” Command in Linux [11 Practical Examples]
- The “apt-get” Command in Linux [10 Practical Examples]
- The “enable” Command in Linux [6 Practical Examples]