TL;DR
On Windows, run shutdown /r /t 0. On a Mac, run sudo shutdown -r now. On Linux, run sudo reboot. Add a timer, a message, or force options when you need them, and use shutdown /a on Windows to cancel a countdown. Save your work first, because a forced restart closes apps without asking.
Your mouse freezes, but the keyboard still works. The command to restart the computer depends on your system. Windows uses shutdown /r /t 0. Macs use sudo shutdown -r now, and Linux uses sudo reboot. Each command tells the operating system to close programs and start again. Save your work first.
What Is the Command to Restart a Computer?
A restart command tells your computer to shut down all running programs and then start up again. Many people also call it a reboot. A restart is different from a shutdown, which turns the computer off, and from signing out, which only ends your session.
Here’s a quick view:
Restart Commands for Every Operating System
Compare the quickest terminal commands for Windows, macOS, and Linux.
| System | Command | What It Does |
|---|---|---|
| Windows (Command Prompt) | shutdown /r /t 0 |
Restarts right now. |
| Windows (PowerShell) | Restart-Computer |
Restarts the computer. |
| Mac (Terminal) | sudo shutdown -r now |
Restarts right now. |
| Linux (Terminal) | sudo reboot |
Restarts the computer. |
What Is the Command to Restart a Windows Computer?
Windows has two main command-line options: Command Prompt and PowerShell. Both are safe for everyday use when you save your work first.
How do you restart with Command Prompt?
- Click Start, type cmd, and press Enter.
- Type shutdown /r /t 0 and press Enter.
The /r switch means restart. The /t 0 switch sets a delay of zero seconds. Without /t, Windows waits 30 seconds by default, according to Microsoft’s documentation. Your account also needs the “Shut down the system” right, which most normal accounts have.
Which shutdown switches matter most?
Windows Shutdown Command Switches
Understand the most useful shutdown options for restarting and managing Windows computers.
| Switch | What It Does |
|---|---|
/r |
Restarts the computer. |
/t xx |
Waits xx seconds before it runs. |
/f |
Forces running apps to close without warning. |
/c "message" |
Shows a message to users. |
/a |
Aborts a pending shutdown or restart. |
/o |
Restarts to the Advanced startup menu (use with /r). |
/fw |
Restarts to the firmware or BIOS screen (use with /r). |
/g |
Restarts and reopens registered apps afterward. |
/m \\computername |
Targets another computer on the network. |
What are the most useful examples?
Windows Restart Commands Cheat Sheet
Useful Command Prompt commands to restart, troubleshoot, and access recovery options.
| Goal | Command |
|---|---|
| Restart now | shutdown /r /t 0 |
| Restart in 60 seconds with a message | shutdown /r /t 60 /c "Restarting for updates" |
| Force restart now | shutdown /r /f /t 0 |
| Restart into Safe Mode options | shutdown /r /o /t 0 |
| Restart into BIOS or UEFI setup | shutdown /r /fw /t 0 |
| Cancel a restart during the countdown | shutdown /a |
The /fw option only works on computers that use UEFI firmware. Most newer PCs do.
How do you restart with PowerShell?
- Right-click Start, then choose Terminal or Windows PowerShell.
- Type Restart-Computer and press Enter.
To force the restart, use Restart-Computer -Force. To target a remote PC, use Restart-Computer -ComputerName PC01 -Force, if you have permission.
Are there shortcuts besides commands?
Yes:
- Run box: Press Win + R, type shutdown /r /t 0, and press Enter.
- Quick menu: Press Win + X, then U, then R.
- Ctrl + Alt + Del: Click the power icon, then Restart.
- Alt + F4 on the desktop: Pick Restart from the list.
- Remote Desktop: Use Ctrl + Alt + End instead of Ctrl + Alt + Del.
Why use Restart instead of Shut down on Windows?
A restart does a full reboot. A shutdown with Fast Startup turned on may keep parts of the system in a saved state. So when you want a clean reset, such as after an update or a glitch, Restart is the better choice.
What Is the Command to Restart a Mac?
Use Terminal, which you’ll find in Applications, then Utilities.
- Open Terminal.
- Type sudo shutdown -r now and press Enter.
- Enter your admin password. You won’t see it as you type.
Other options:
Mac Restart Commands
Three useful ways to restart your Mac using Terminal or macOS tools.
| Goal | Command |
|---|---|
| Restart now | sudo reboot |
| Restart in 5 minutes | sudo shutdown -r +5 |
| Restart through System Events | osascript -e 'tell app "System Events" to restart' |
For a normal restart, the Apple menu is the safest route. Choose Apple menu, then Restart. Terminal commands act quickly, so save your files before you run them.
What Is the Command to Restart a Linux Computer?
Open a terminal. Most Linux restart commands need sudo, which runs the command with administrator rights.
Linux Restart Commands Cheat Sheet
Quick terminal commands to restart now, schedule a reboot, or cancel a planned restart.
| Goal | Command |
|---|---|
| Restart now | sudo reboot |
| Restart now (another way) | sudo shutdown -r now |
| Restart with systemd | sudo systemctl reboot |
| Restart in 10 minutes | sudo shutdown -r +10 |
| Restart at a set time | sudo shutdown -r 23:00 |
| Restart with a message | sudo shutdown -r +10 "Restarting for updates" |
| Cancel a scheduled restart | sudo shutdown -c |
All three restart commands do the same job on most modern systems. The shutdown command is handy because it lets you schedule and cancel.
When Should You Use a Force Restart Command?
Use a force restart only when the normal restart fails. Forcing a restart can close programs without saving your work. It can also damage files that were being written.
Common force options:
- Windows: shutdown /r /f /t 0 or Restart-Computer -Force
- Linux: sudo reboot -f or sudo systemctl reboot –force, which skip a clean shutdown of services. Use them carefully.
- Any system: Holding the power button for several seconds is the last resort.
Try the normal restart first. Then try a force command. Use the power button only if nothing else works.
How Do You Restart a Remote Computer?
You need permission and a network path to the other computer.
- Windows Command Prompt: shutdown /r /m \\PCNAME /t 60 /c “Restarting for maintenance”
- Windows PowerShell: Restart-Computer -ComputerName PCNAME -Force
- Linux over SSH: ssh user@hostname ‘sudo reboot’
A few warnings apply. Remote restarts can fail if a firewall blocks the connection, or if your account lacks permission. Don’t restart a shared or production machine without warning people. Use a delay and a message so they can save their work.
Why Won’t the Restart Command Work?
Common Restart Problems and How to Fix Them
Identify common restart errors, understand their causes, and find the right solution.
| Problem | Likely cause | Fix |
|---|---|---|
| Access is denied | Your account lacks permission. | Open an administrator Command Prompt or use sudo. |
| Restart seems stuck | An app is blocking the restart. | Save your work, then use /f or wait. |
| Remote restart fails | Firewall, wrong name, or no permission. | Check the network name, permissions, and firewall rules. |
| Command not found | Typo or wrong system. | Check the spelling and your operating system. |
| Mac asks for a password | sudo needs administrator rights. | Enter your administrator password. |
| Stuck on “Restarting” for a long time | Updates are installing. | Wait several minutes before forcing anything. |
How Can You Use Restart Commands Safely?
- Save your work before you press Enter.
- Warn others if the computer is shared.
- Use a timer. A short delay gives you time to cancel.
- Keep the abort command ready, like shutdown /a on Windows.
- Avoid force switches unless you must use them.
- Test on a non-critical computer before you script restarts.
- Don’t paste commands from unknown sources without understanding them.
Conclusion
The right command to restart computer depends on your system. Windows uses shutdown /r /t 0, Macs use sudo shutdown -r now, and Linux uses sudo reboot. Add a timer or message when you want control, use force options only when needed, and always save your work first.
Open your terminal and try a harmless delayed restart now, then cancel it, to see how the commands work. Then explore more computer guides at Techprixo, and share this article with someone who still holds the power button.
FAQ
Open Command Prompt and type shutdown /r /t 0, then press Enter. The /r switch restarts the computer, and /t 0 sets a zero-second delay. In PowerShell, type Restart-Computer. Save your work first, since programs will be asked to close.
Open Terminal and type sudo shutdown -r now, then enter your admin password. You can also use sudo reboot. Both commands restart quickly, so save your files before you run them. For a normal restart, use the Apple menu, then Restart.
Type sudo reboot, sudo shutdown -r now, or sudo systemctl reboot. All three restart the machine. To schedule a restart, use sudo shutdown -r +10 for ten minutes from now, and cancel it with sudo shutdown -c. Use sudo because restarting needs administrator rights.
On Windows, open Command Prompt and type shutdown /a during the countdown. Linux uses sudo shutdown -c. You must cancel before the timer ends. If you used /t 0, the restart starts immediately and can’t be stopped, so use a delay when you want time to change your mind.
Type shutdown /r /o /t 0 to restart into the Advanced startup menu, where you can open Safe Mode through Troubleshoot options. Use shutdown /r /fw /t 0 to restart into the firmware or BIOS screen on UEFI computers. Run these in Command Prompt, and save your work first.
2 thoughts on “Command to Restart Computer: Windows, Mac, and Linux Commands Explained”