How to reboot Linux using the command line

If you have a computer with the same keyboard as the Raspberry Pi or you are running a headless computer (without a display), you can learn how to turn off the computer and physically pull the power. Without having to restart it.

How to shut down your computer using Linux

Most likely you will need high privileges to use the shutdown command, so you are likely to use the sudo command as follows:

The output from the above command will say something on the “Shutdown schedule, use to cancel shutdown -c” lines.
Your closing time In general, it is better to tell when you turn off the computer. On the off chance that you need the computer to close down quickly, utilize the accompanying command. The time factor can be described in several ways. For example, you can use the following command to shut down your computer immediately: Number refers to the number of minutes before the system tries to shut down. Incidentally, the command pseudo shutdown is the same as running the following command without an element. The default is 1 minute. You can also specify a specific time in hours and minutes to shut down your computer as follows.

When the shutdown time is less than 5 minutes, the system will no longer allow users to log in.

Visit more: TechsTribe

Other closed switches

If you’re running the system with more than one user, you can specify a message that will appear on all user screens, telling them it’s about to shut down.

To complete, there is another switch that you can use as shown below:

Technically, you don’t need to use the PP parameter, because it’s powered off and the default action for power off is to turn off the power. If you want to guarantee that the machine is off and not just stop, then use the -P switch.
If you’re good at memorizing words on switches, you might prefer to use the following.

The command to reboot your computer is also off. There is a reboot command that is used for legacy purposes. Logically speaking, this is a more explicit command to use to reboot your computer, but most people use the following command to reboot their computers.

The same rules apply to the reboot command as they do to the shutdown command. This means that by default, the shutdown command will reboot the computer after 1 minute.

  • To restart immediately, you must specify the following command:
  • If you want the computer to restart in 5 minutes, you can specify the following command.
  • You can also specify a time to reboot the computer in the following hours and minutes.
  • Finally, like the shutdown procedure, you can point to a message to show all users of the system, and let them know that the system is malfunctioning.
  • If you prefer, you can use the following instead of the R-switch:

Add a Comment

Your email address will not be published.