Learn how to close all open windows/folders/tabs on a Mac with three different methods.
To close a single-window on Mac, whether it’s a browser tab or a Finder window, while inside the window you want to close, hold down CMD and hit W on your keyboard once.
To close all open windows or browser tabs on Mac, simply continue to hold down CMD while tabbing W. Your windows will close quickly one at a time until all windows are closed. It will take a few seconds, depending on how many open windows you have. You can also just hold down CMD + W (no W tabbing needed) to do it even faster.
To close all windows on your Mac at the same time, hold down CMD + Option + W. If you do this while a Finder window is open, it will shut down all open Finder windows, but not other apps’ windows.
Good to know: be careful using the close all windows at the same time shortcut (CMD + Option + W). E.g. if your Chrome browser is open while you run the command it will shut down every open Chrome browser client on your Mac (not just the client you’re inside), which might not be what you want.