Old English sceafan (strong verb, past tense scof, past participle scafen), "to scrape, shave, polish," from Proto-Germanic *skaban (source also of Old Norse skafa, Middle Dutch scaven, German schaben, Gothic skaban "scratch, shave, scrape"), from PIE *skabh-, collateral form of root *(s)kep- "to cut, to scrape, to hack" (see scabies). Related: Shaved; shaving. Original strong verb status is preserved in past tense form shaven. Specifically in reference to cutting the hair close from mid-13c. Figurative sense of "to strip (someone) of money or possessions" is attested from late 14c.
c. 1600, "something shaved off;" from shave (v.); Old English sceafa meant "tool for shaving." Meaning "operation of shaving" is from 1838. Meaning "a grazing touch" is recorded from 1834. Phrase a close shave is from 1856, on notion of "a slight, grazing touch."