Mac OS keyboard shortcuts

Desktop controls
Show desktop: fn + F11
Switch an application to bring it to the front: command + tab, hold command and keep pressing tab make a selection
Quit an application: command + q
Logout: command + shift + q
Force quit an application: command + option + esc
Restart, Shutdown and Sleep: Press the Power key, make a selection
Force to Restart immediately: command + control + Power key, only do this when you have to

Text Controls
Go to the first beginning of a file: Command + up arrow
Go to the end of file: command + down arrow
Go to the beginning of a line: command + left arrow
Go to the end of a line: command + right arrow
Select character one by one consecutively: Shift + arrow key
Select the entire line from the current cursor: shift + command + right arrow

Screenshots
Take a screenshot of the entire screen: command + shift + 3
Take a screenshot of selected area: command + shift + 4
Take a screenshot of an application window: command + shift + 4 and then press Space

Terminal command line control
Go to the beginning of the command line: control + a
Go to the end of the command line: control + e
Move forward a word on the command line: esc + f
Move backward a word on the command line: esc + b
Remove the current command line text: control + a and then control + k