How To Reboot Linux System Using Command Line

Refer the following video tutorial if you want to know how to restart VPS via “my.1onlyhost.net”. If you prefer to reboot via command line tools then read further.

In this tutorial we can learn how to reboot the Linux system using command line tools.

If you have a single board computer or you are running a headless computer (one without a display) then you might want to know how to shut the computer down and restart it without physically pulling the power. In this documentation, we can discuss about how to shut down and reboot your system using the Linux command line.

How to shut down your system using command line

The shutdown command brings the system down in a secure way. All the logged-in users are notified that the system is going down, and login operations are blocked. It is possible to shut the system down immediately, or after a specified delay.

 

1) You can use the following command to shut down your system.

$ shutdown

2) If you have no privileges to use the shutdown command, you can use the sudo command as follows.

$ sudo shutdown

3) If you want the computer to shutdown immediately, you can use the following command.

$ sudo shutdown now

4) You can also use the fooling command to shutdown the system immediately.

$ sudo shutdown 0

The number specifies the number of minutes to wait before the system attempts to shutdown.

5) If you want the computer to shut down the system after one minute, use the following command.

$ sudo shutdown 1

6) You can also specify the time in hours and minutes to shutdown your system.

$ sudo shutdown 22:00

If the amount of time until shut down is less than 5 minutes the system will not allow any more users to login.

7) If you need to bring down the system immediately, and automatically power off the system, use the below given command.

$ shutdown -P now

If you are better at remembering words more than switches, you might prefer to use the following command.

$ sudo shutdown –poweroff now

8) If you are running a system with multiple users you can specify a message which will appear on all users screens letting them know that a shutdown is going to occur.

$ sudo shutdown 5 “system is going shutdown, please save your work”

 

How to reboot your system using command line

1) The command for rebooting your computer is also shutdown. Use following command to reboot your system.

$ sudo shutdown -r

2) To reboot your system immediately, you can use either of the following commands.

$ sudo shutdown -r 0

$ sudo shutdown -r now

3) If you want the computer to shutdown the system after five minute, use the following command.

$ sudo shutdown -r 5

4) You can also specify the time in hours and minutes to shutdown your system.

$ sudo shutdown -r 22:00

5) you can specify a message to be displayed to all users of the system letting them know the system is going down.

$ sudo shutdown -r 5 “system is going reboot, please save your work”

6) If you prefer, you can use the word reboot instead of -r switch.

$ sudo shutdown –reboot now

 

If you need any further assistance please contact our support department.

 

Was this answer helpful? 0 Users Found This Useful (0 Votes)