Specific military sense of "army officer next in rank to a captain and commanding the company in his absence" is from 1570s. Pronunciation with lef- is common in Britain, and spellings to reflect it date back to 14c., but the origin of this is a mystery (OED rejects suggestion that it comes from old confusion of -u- and -v-).
It forms all or part of: abstain; abstention; abstinence; abstinent; atelectasis; attend; attenuate; attenuation; baritone; catatonia; catatonic; contain; contend; continue; detain; detente; detention; diatonic; distend; entertain; extend; extenuate; hypotenuse; hypotonia; intend; intone (v.1) "to sing, chant;" isotonic; lieutenant; locum-tenens; maintain; monotony; neoteny; obtain; ostensible; peritoneum; pertain; pertinacious; portend; pretend; rein; retain; retinue; sitar; subtend; sustain; tantra; telangiectasia; temple (n.1) "building for worship;" temple (n.2) "flattened area on either side of the forehead;" temporal; tenable; tenacious; tenacity; tenant; tend (v.1) "to incline, to move in a certain direction;" tendency; tender (adj.) "soft, easily injured;" tender (v.) "to offer formally;" tendon; tendril; tenement; tenesmus; tenet; tennis; tenon; tenor; tense (adj.) "stretched tight;" tensile; tension; tensor; tent (n.) "portable shelter;" tenterhooks; tenuous; tenure; tetanus; thin; tone; tonic.
It is the hypothetical source of/evidence for its existence is provided by: Sanskrit tantram "loom," tanoti "stretches, lasts," tanuh "thin," literally "stretched out;" Persian tar "string;" Lithuanian tankus "compact," i.e. "tightened;" Greek teinein "to stretch," tasis "a stretching, tension," tenos "sinew," tetanos "stiff, rigid," tonos "string," hence "sound, pitch;" Latin tenere "to hold, grasp, keep, have possession, maintain," tendere "to stretch," tenuis "thin, rare, fine;" Old Church Slavonic tento "cord;" Old English þynne "thin."
military rank above captain and below lieutenant colonel, 1640s, from French major, short for sergent-major, originally a higher rank than at present, from Medieval Latin major "chief officer, magnate, superior person," from Latin maior "an elder, adult," noun use of the adjective (see major (adj.)).
His chief duties consist in superintending the exercises of his regiment or battalion, and in putting in execution the commands of his superior officer. His ordinary position in the line is behind the left wing. [Century Dictionary, 1897]
The musical sense is attested by 1797.
Military sense of "officer who commands a company" (rank between major and lieutenant) is from 1560s; naval sense of "officer who commands a man-of-war" is from 1550s, extended to "master or commander of a vessel of any kind" by 1704. Sporting sense "leader of the players on a team" is recorded by 1823. The other Germanic words also are from French.
1670s, "system of strict discipline," from the name of French military officer Jean Martinet (killed at the siege of Duisburg, 1672), lieutenant colonel in the Régiment du Roi, who in 1668 was appointed inspector general of the infantry. "It was his responsibility to introduce and enforce the drill and strict discipline of the French regiment of Guards across the whole infantry" [Olaf van Minwegen, "The Dutch Army and the Military Revolutions 1588-1688," 2006].
The meaning "an officer who is a stickler for discipline and regularity in small details" is first attested 1779 in English, but "No F[rench] use of the word in the sense of a disciplinarian appears" [Century Dictionary]. The surname is a diminutive of Latin Martinus (see Martin). Related: Martinetism.
late 14c., "seacoast;" see marine (adj.). Meaning "collective shipping of a country" is from 1660s. Meaning "soldier who serves on a ship" is from 1670s, a separate borrowing from French marine, from the French adjective. Phrase tell that to the marines (1805) originally was the first half of a retort expressing disbelief in some statement made or story told:
"Upon my soul, sir," answered the lieutenant, "when I thought she scorned my passion, I wept like a child."
"Belay there!" cried the captain; "you may tell that to the marines, but I'll be d----d if the sailors will believe it." ["John Moore," "The Post-Captain; or, the Wooden Walls Well Manned," 1805]
The book, a rollicking sea romance/adventure novel, was popular in its day and the remark is a recurring punch line in it (repeated at least four times). It was written by naval veteran John Davis (1774-1854) but published under the pseudonym "John Moore." Walsh records that, among sailors, marines are "a proverbially gullible lot, capable of swallowing any yarn, in size varying from a yawl-boat to a full-rigged frigate."