On Mac OS X, you can easily take screenshots of your desktop by pressing shortcut keys on your keyboard. (More on that here.) However, all of your screenshots will go to your desktop by default. To change this, open up Terminal by going to Applications > Utilities > Terminal, or by simply using Spotlight to search for Terminal, and copy and paste the following commands:

defaults write com.apple.screencapture location /path/to/screenshots

A common place to switch the screenshot location to might look something like this:

defaults write com.apple.screencapture location ~/Pictures/Screenshots

This will place the screenshots into a folder called Screenshots in your Pictures folder in your Home folder. Be sure to create the folder structure before you actually try and take a screenshot.

To apply these changes, again in Terminal, type:

killall SystemUIServer

And, to change it back to the default desktop location, simply type in:

defaults write com.apple.screencapture location ~/Desktop/

UPDATE: New post on how to change the file type of your screenshots here!

That’s it! Hope this hint has helpful, post any questions or concerns in the comments below.