shutdown
command is used to halt, shutdown, reboot, restart the given system. shutdown
command can be used for both Linux and Windows. In this tutorial, we will examine the shutdown r
command usage.
Reboot/Restart Computer
r
option is mainly used to restart or reboot the system. If we do not provide any extra option the system will reboot after 60 seconds or 1 minute. This time is used to provide the users to complete and save their works.
> shutdown /r
Reboot/Restart Immediately
If we know that there are no other users connected to the server or we do not want to wait for 1 minute to reboot we can use /t 0
option. This option means restart or reboot the system immediately with 0 second wait time.
> shutdown /r /t 0
Reboot/Restart At Specified Time
We may want to reboot after work or after time passed. If we want to reboot at a specified time we can use /t
option with a time value in seconds. In this example, we will restart the system after 1 hour which is equal to 3600 seconds.
> shutdown /r /t 3600
Restart after 10 minutes
> shutdown /r /t 600
Restart after 1 day
> shutdown /r /t 14400
Restart after 8 hours
> shutdown /r /t 4800
Reboot/Restart Remote Server or Computer
Up to now we have restarted or rebooted given local system or server. We can also reboot or restart a remote server or computer by providing its hostname or IP address. We will use \\
with the server hostname or IP address. In this example, we will reboot the host named POFTUT1
.
> shutdown /r \\POFTUT1
Cancel Reboot
After issuing a reboot or restart command we may need to cancel the reboot or restart operation. We can use /a
option which will cancel or abort current issued shutdown
operations like restart and reboot.
> shutdown /a