popular name of a common bird of Europe, Asia, and America, known for its chattering, acquisitiveness, curiosity, and mimicry, c. 1600, earlier simply pie (mid-13c.).
The first element is Mag, nickname for Margaret, long used in proverbial and slang English for qualities associated generally with women, especially in this case "idle chattering" (as in Magge tales "tall tales, nonsense," early 15c.; also compare French margot "magpie," from Margot, pet form of Marguerite). The name Margaret, and its reduced forms Mag, Madge, diminutive Maggie, also has long been familiarly applied to birds. Pies were proverbial since Middle English for chattering (as were jays), hence the application of pie to a prattling gossip or tattler, also "sly person, informer" (late 14c.) and in 15c.-16c. a wily pie (or wyly pye) was "a cunning person."
The second element, pie, is the earlier name of the bird, from Old French pie, from Latin pica "magpie" (source also of Spanish pega), fem. of picus "woodpecker," from PIE root *(s)peik- "woodpecker, magpie" (source also of Umbrian peica "magpie," Sanskrit pikah "Indian cuckoo," Old Norse spætr, German Specht "woodpecker"); possibly from PIE root *pi-, denoting pointedness, of the beak. The application to pies might be because the magpie also has a long, pointed tail.
The birds are proverbial for pilfering and hoarding and for their indiscriminate appetites (see pica (n.2)); they can be taught to speak, and have been regarded since the Middle Ages as ill omens.
Whan pyes chatter vpon a house it is a sygne of ryghte euyll tydynges. 
Divination by numbering magpies is attested from c. 1780 in Lincolnshire; the rhyme varies from place to place, the only consistency being that one is bad, two are good.
The councils which magpies appear to hold together, at particular seasons, commonly called "folkmotes," are associated in the minds of many with superstitious and ominous notions. The innocent objects of terror, while meeting together most probably for the purpose of choosing mates, are supposed to be conspiring and clubbing their wits, for the weal or woe of the inhabitants of the neighbouring village. If they are of an even number and carry on their cheerful, noisy chatter, it is supposed to betoken good to old and young—but if there is an odd magpie perched apart from the rest, silent, and disconsolate, the reverse of this is apprehended, and mischievous consequences are inevitably expected. [The Saturday Magazine, Jan. 23, 1841]
a Middle English merger of Old English line "cable, rope; series, row, row of letters; rule, direction," and Old French ligne "guideline, cord, string; lineage, descent" (12c.), both from Latin linea "linen thread, string, plumb-line," also "a mark, bound, limit, goal; line of descent," short for linea restis "linen cord," and similar phrases, from fem. of lineus (adj.) "of linen," from linum "linen" (see linen).
The earliest sense in Middle English was "cord used by builders for taking measurements;" extended late 14c. to "a thread-like mark" (from sense "cord used by builders for making things level," mid-14c.), also "track, course, direction." Meaning "limit, boundary" (of a county, etc.) is from 1590s. The mathematical sense of "length without breadth" is from 1550s. From 1530s as "a crease of the face or palm of the hand." From 1580s as "the equator."
Sense of "things or people arranged in a straight line" is from 1550s. Now considered American English, where British English uses queue (n.), but the sense appears earliest in English writers. Sense of "chronologically continuous series of persons" (a line of kings, etc.) is from late 14c.
Meaning "one's occupation, branch of business" is from 1630s, according to OED probably from misunderstood KJV translation of II Corinthians x.16, "And not to boast in another mans line of things made ready to our hand," where line translates Greek kanon which probably meant "boundary, limit;" the phrase "in another man's line" being parenthetical.
Commercial meaning "class of goods in stock" is from 1930, so called from being goods received by the merchant on a line in the specific sense "order given to an agent" for particular goods (1834). Insurance underwriting sense is from 1899. Line of credit is from 1958.
Meaning "series of public conveyances" (coaches, later ships) is from 1786; meaning "continuous part of a railroad" is from 1825. Meaning "telegraph wire between stations" is from 1847 (later "telephone wire"). Meaning "cord bearing hooks used in fishing" is from c. 1300. Meaning "policy or set of policies of a political faction" is 1892, American English, from notion of a procession of followers; this is the sense in the political party line, and, deteriorated, it is the slang line that means "glib and plausible talk meant to deceive."
In British army, the Line (1802) is the regular, numbered troops, as distinguished from guards, auxiliaries, militia, etc. In the Navy (1704) it refers to the battle line (the sense in ship of the line, which is attested from 1706).
Dutch lijn, Old High German lina, German Leine, Old Norse lina "a cord, rope," are likewise from Latin. Spanish and Italian have the word in the learned form linea. In continental measurements, a subdivision of an inch (one-tenth or one-twelfth in England), attested in English from 1660s but never common. Also see lines.
To get a line on "acquire information about" is from 1903. To lay it on the line is from 1929 as "to pay money;" by 1954 as "speak plainly." End of the line "as far as one can go" is from 1948. One's line of work, meaning "pursuit, interest" is from 1957, earlier line of country (1861). Line-drawing is from 1891. A line-storm (1850) is a type supposed to happen in the 10 days or two weeks around the times the sun crosses the equator.