To capture the entire screen: Press and hold Cmd + Shift + 3 together. (That is, the Cmd button, the Shift key, and the number 3).
To capture a region: Press Cmd + Shift + 4 together. Your cursor becomes a cross-hair icon. You can click and drag this over the region you want to capture. When you release, the region will be captured.
To capture a window: Press Cmd + Shift + 4 + Spacebar. Your cursor becomes a camera icon. Click the window you wish to capture. (It will highlight when you mouse over it.)
For more flexibility, including an option to annotate your screenshot afterwards, use “Screenshot” app. (You can search for it using the Launch Pad, or look for it in Applications → Utilities.) See the Apple Support Page for more information.
In all cases, the screen shot will save on your desktop with a title “Screen Shot” and the date and time by default.
Linux
You can either use a combination of keystrokes, or a screenshot application.
Keystrokes may depend on the version of linux you are using.
To capture the entire screen: Press PrtScr. This will save a copy of the entire screen to the ~/Pictures directory.
To capture a window: Press ALT + PrtScr (unmodified). This will save a copy of the window under the mouse pointer.
To capture a region: Press and hold shift, press and release PrtScr. This will change the mouse pointer to a + and you can select a region of the screen with the left mouse button.
Modifying each of these commands by adding the CTRL key will copy the selected image to the copy buffer.
Hold CTRL, Press PrtScr will copy a screen shot of the entire screen to the copy buffer.
Hold CTRL, Hold Alt, Press PrtScr will copy the selected window to the copy buffer.
Hold CTRL, Hold Shift, Press PrtScr will allow you to select a region of the screen and copy it to the copy buffer.
For more flexibility, there are multiple applications available that will allow you to take a screenshot.