You use xdotool. Note that the default unity shortcut key for minimizing the active window is Ctrl-Alt-0 BUT that this ONLY means the numeric keypad zero. If you type the regular zero key, the one between the 9 and the -, then it will not work. (Also not when typing it on the keyboard.

Xdotool knows the numeric keypad zero key as 'KP_Insert'.

So to minimize the active window, you first make sure xdotool installed, then use the command: