Click any Finder window, then press Option-Command-W. All Finder windows close at once. The same shortcut closes all windows of whichever app is in front, so make sure the Finder is the active app first.
Close all Finder windows with the keyboard
- Click a Finder window or the Finder icon in the Dock, so that Finder is the name next to the Apple menu.
- Press Option-Command-W.
Command-W alone closes only the front window. Adding the Option key applies it to all windows of the app. The Finder itself keeps running. Apple notes that it is always open.
Close all Finder windows from the File menu
- With the Finder active, open the File menu.
- Press and hold the Option key. The Close command changes to Close All.
- Choose Close All.
Holding Option reveals hidden commands in many Mac menus, and Close All in the File menu works this way in many apps.
Keep Finder windows from piling up
- Merge the open windows into one. Choose Window → Merge All Windows. All Finder windows become tabs of a single window.
- Open folders in tabs. Choose Finder → Settings, click General and select Open folders in tabs instead of new windows. A folder then opens in a tab when you hold Command and double-click it.
- Get windows out of the way without closing them. Option-Command-M minimizes all windows of the front app to the Dock. Command-H hides the app with all its windows.
The same shortcut in other apps
Option-Command-W closes all windows of the front app in most Mac apps. Closing the windows does not quit the app. It stays open, with a small dot below its icon in the Dock, until you press Command-Q.
If you want apps to forget their windows when you quit them, open System Settings → Desktop & Dock and turn on Close windows when quitting an application. The windows then do not reopen the next time you open the app.
Close tabs in Safari
Safari has its own commands for tabs:
- Close the active tab: press Command-W.
- Close all other tabs: Control-click the tab you want to keep and choose Close Other Tabs. You can also hold Option and click the close button on the tab you want to keep.
- Close the tabs to one side: Control-click a tab and choose Close Tabs to the Right.
- Bring back a tab you closed by mistake: press Shift-Command-T.
- Let Safari tidy up: choose Safari → Settings, click Tabs and set Automatically close tabs to one day, one week or one month.
Hide tabs instead of closing them
Closing everything is not the only way to clear the screen when someone walks up. In Kingpin, our private browser for Mac, you double-tap a key or click the Kingpin button and every tab hides behind a page you chose, then comes back with your PIN or Touch ID.