The fastest keyboard shortcut to shut down your computer

On Windows, press Alt + F4 while you are on the desktop (not inside any open program). A dialog box will appear asking if you want to shut down. Press the down arrow key once to highlight "Shut down," then press Enter. Your computer will close all programs and power off.

On Mac, press Command + Q to close the active program, then press Command + Control + Eject (or Command + Control + Power on newer models). A dialog will ask if you want to shut down when ready or cancel. Press Enter to confirm shutdown.

On Linux, the keyboard method depends on your desktop environment. In most distributions, press Alt + F2, type shutdown -h now, and press Enter. Some systems also respond to Ctrl + Alt + Delete followed by arrow keys to select shutdown.

Key Takeaways

  • Windows users can shut down from the desktop by pressing Alt + F4, then using arrow keys to select "Shut down" and pressing Enter.
  • Mac users should press Command + Control + Eject (or Command + Control + Power on newer models) and confirm with Enter.
  • Linux shutdown varies by desktop environment but often uses Alt + F2 followed by typing the shutdown command.
  • If a program is frozen and blocking shutdown, force-quit it first using Alt + F4 on Windows or Command + Q on Mac before attempting system shutdown.

Windows shutdown from inside a program

If you have a program open and want to shut down without closing it first, press Alt + F4 while the program window is active. Windows will ask if you want to save any unsaved work in that program. If you click "Don't Save" or press the right arrow key then Enter, Windows will close the program and return you to the desktop, where you can use Alt + F4 again to shut down the system.

Alternatively, you can press Windows key + X to open the power menu, then press U twice (once for "Shut down" and once to confirm). This works from anywhere on your system, including from inside programs, and does not require you to close anything first.

Mac shutdown from any screen

On Mac, the most direct keyboard method is Command + Control + Eject (on older keyboards) or Command + Control + Power (on newer MacBooks without an Eject key). This brings up a shutdown confirmation dialog. Press Enter to shut down when ready, or press Escape to cancel.

If you want a gentler shutdown that gives open programs a chance to save their work, press Command + Control + Q instead. This logs you out and shuts down the system after a short delay, allowing programs to close gracefully. On some Mac models, you may need to press and hold these keys for a moment before the dialog appears.

Linux shutdown using the terminal

On Linux, the most reliable keyboard method is to open a terminal and type a shutdown command. Press Ctrl + Alt + T to open the terminal on most distributions (Ubuntu, Linux Mint, Fedora). Then type shutdown -h now and press Enter. The system will shut down when ready.

If you want the system to shut down after a delay—for example, to give yourself time to save work—type shutdown -h +5 (replacing 5 with the number of minutes you want to wait). To cancel a scheduled shutdown before it happens, press Ctrl + Alt + T again, type shutdown -c, and press Enter.

What to do if your computer will not shut down

If you press the shutdown keys and nothing happens, a frozen program may be blocking the process. On Windows, press Ctrl + Alt + Delete to open the Task Manager. Use the arrow keys to navigate to the program that is not responding, press the right arrow key to highlight it, then press Delete to force-close it. After the program closes, try Alt + F4 again to shut down.

On Mac, press Command + Option + Escape to open the Force Quit dialog. Use arrow keys to select the frozen program and press Enter to force-quit it. Then use Command + Control + Eject to shut down the system. On Linux, if the terminal command does not work, try pressing Ctrl + Alt + F2 to switch to a text-only login screen, log in, and type the shutdown command again.

Restarting instead of shutting down

If you need to restart your computer instead of shutting it down completely, the keyboard shortcuts are similar. On Windows, press Alt + F4 from the desktop, use the arrow keys to select "Restart," and press Enter. On Mac, press Command + Control + Power and then press the right arrow key to select "Restart" before pressing Enter.

On Linux, type shutdown -r now in the terminal to restart when ready, or shutdown -r +5 to restart after a delay. The restart process closes all programs and reboots the operating system, which is useful when you need to clear temporary files or explore system updates.

Frequently Asked Questions

Will Alt + F4 save my work before shutting down?

Alt + F4 will prompt each open program to save unsaved work, but only if you close programs one at a time. If you use Alt + F4 from the desktop, Windows will shut down without checking for unsaved files in background programs. Close your programs individually first, or use Windows key + X to open the power menu, which gives programs a moment to save before powering off.

What is the difference between shutdown and restart?

Shutdown powers off your computer completely. Restart closes all programs and reboots the operating system while keeping the computer on. Restart is useful when a program is frozen or when you have installed updates that require a reboot. Both use similar keyboard shortcuts—just select "Restart" instead of "Shut down" in the dialog.

Can I schedule a shutdown to happen at a specific time?

On Windows, open the Run dialog (Windows key + R), type shutdown -s -t 3600 (replacing 3600 with the number of seconds you want to wait), and press Enter. On Mac and Linux, use the terminal commands shutdown -h +120 (for 2 hours) or at 10:00 PM shutdown -h to schedule shutdown for a specific time.

What should I do if my keyboard is not working?

If your keyboard is unresponsive, you can use your mouse or trackpad to shut down through the graphical menu instead. On Windows, click the Start button and select "Shut down." On Mac, click the Apple menu and select "Shut Down." If both keyboard and mouse are frozen, hold the power button for 10 seconds to force the computer to power off, though this may cause data loss.

Does shutting down with the keyboard damage my computer?

No. Using keyboard shortcuts to shut down is the standard method and does not harm your computer. It gives the operating system time to close programs and save system files properly. Force-shutting down by holding the power button repeatedly, by contrast, can cause data loss and should only be used when the system is completely frozen.