Minimize windows into the applications Dock icon
If you’re tired of having your Dock full of thumbnailed versions of minimized windows, you can change the Dock’s minimize behavior with a simple Terminal command that will minimize windows into the parent applications Dock icon. You can then tell which windows are minimized by looking for the diamond next to the window name (see screenshot). This is very helpful in particular if you’re working with a limited screen resolution, or if you have a Dock that is loaded to the brim with applications and folders.
If you want to enable this feature, launch the Terminal and enter the following command:
defaults write com.apple.dock minimize-to-application -BOOL YES
With how useful this is I’m surprised it’s not an option somewhere within the Mac OS X GUI preferences.

Hey, there is an option in the GUI
System Preferences – Dock- Minimize windows into dock icon
Or you could check the Minimized windows into Application Dock in the Dock System Preference
Is this SnowLeopard only??
Doesn;t work on 10.5
i get the following error
Unexpected argument YES; leaving defaults unchanged.
I agree with Rushabh, this works better:
System Preferences > Dock > tick checbox “Minimize windows into dock icon” (lower part of the window)
The command line provided in the post also gives me the same error Coinneach gets
The same to me. It doesn’t work on 10.5.
[...] Dock app icon and selecting the window directly. Yes, we have covered this tip before but it was by changing the minimize behavior via the command line, I find it much more simple to do this tricks through the GUI whenever [...]
Unfortunately, this tip only works in Snow Leopard.