Middle English shaken, from Old English sceacan "move (something) quickly to and fro, cause to move with quick vibrations; brandish; move the body or a part of it rapidly back and forth;" also "go, glide, hasten, flee, depart" (as in sceacdom "flight"); also intransitive, of persons or parts of the body, "to tremble" especially from fever, cold, fear (class VI strong verb; past tense scoc, past participle scacen).
This is reconstructed to be from Proto-Germanic *skakanan "to shake, swing," also "to escape" (source also of Old Norse, Swedish skaka, Danish skage "to shift, turn, veer"). There are said to be no certain cognates outside Germanic, but some sources suggest a PIE root *(s)keg- "to jump, to move" (compare Sanskrit khaj "to agitate, churn, stir about," Old Church Slavonic skoku "a leap, bound," Welsh ysgogi "move"). Also compare shock (n.1).
Of the ground in earthquakes, c. 1300. The meaning "seize and shake" (someone or something else) is from early 14c. From late 14c. in reference to mixing ingredients, etc., by shaking a container. The meaning "weaken, impair" in any respect is from late 14c. on the notion of "make unstable." The meaning "rid oneself of by abrupt twists" is from c. 1200; the modern colloquial use for "get rid of, cast off, abandon" (by 1872, American English) is likely a new extension on the notion of "throw off by a jolting or abrupt action," perhaps with horses in mind. The verb also was used in Middle English as "evade" responsibility, etc.
To shake hands "greet or salute by grasping one another's hands" dates from 1530s. Colloquial shake a (loose) leg "hurry up" is recorded by 1904; to shake a heel (sometimes foot) is an old or provincial way to say "dance" (1660s); to shake (one's) elbow (1620s) meant "to gamble at dice." In 16c.-18c. English, shake (one's) ears was "bestir oneself," an image of animal awakenings. The phrase more _____ than you can shake a stick at "more than you can count" is attested from 1818 (Lancaster, Pa., "Journal"), American English. To shake (one's) head "move one's head from side to side as a sign of disapproval" is recorded from c. 1300.