The “reboot” Command in Linux [3 Practical Examples]

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...]

Note: Here, the OPTION is enclosed by square brackets means that OPTION is not mandatory for the command. And three dots preceded by OPTION means that the reboot command can take multiple 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.

Note: All options in Linux are case-sensitive. Therefore, you must be careful while using these. Moreover, The man page of the reboot command also contains the options of the halt command and the power off command. To know specifically about the reboot command, check example 3.

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

sudo reboot command in the terminal.➌ Now, press the ENTER button.

Output >

The following image shows that the reboot command has rebooted my system.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

sudo systemctl reboot in the terminal.➌ 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.I have rebooted my system with the systemctl command along with the reboot command.

Note: The “sudo reboot” command is a basic command which invokes the kernel to reboot the system, whereas the “sudo systemctl reboot” command uses the systemd init daemon process to initiate the rebooting.

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.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

Rate this post
LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now
icon linux
Susmit Das Gupta

Hello everyone. I am Susmit Das Gupta, currently working as a Linux Content Developer Executive at SOFTEKO. I am a Mechanical Engineering graduate from Bangladesh University of Engineering and Technology. Besides my routine works, I find interest in going through new things, exploring new places, and capturing landscapes. Read Full Bio

Leave a Comment