bar (n.1)
late 12c., "stake or rod of iron used to fasten a door or gate," from Old French barre (12c.) "beam, bar, gate, barrier," from Vulgar Latin *barra "bar, barrier," which some suggest is from Gaulish *barros "the bushy end" [Gamillscheg], but OED regards this as "discredited" because it "in no way suits the sense." Of soap, by 1833; of candy, by 1906 (the process itself dates to the 1840s). Meaning "bank of sand across a harbor or river mouth" is from 1580s, probably so called because it was an obstruction to navigation. Bar graph is attested from 1925. Bar code first recorded 1963. Behind bars "in prison" is attested by 1934, U.S.
bar (v.)
c.1300, "to fasten (a gate, etc.) with a bar," from bar (n.1); sense of "to obstruct, prevent" is recorded by 1570s. Expression bar none "without exception" is recorded from 1866.
bar (n.2)
"tavern," 1590s, so called in reference to the bars of the barrier or counter over which drinks or food were served to customers (see bar (n.1)).
bar (n.3)
"whole body of lawyers, the legal profession," 1550s, a sense which derives ultimately from the railing that separated benchers from the hall in the Inns of Court. Students who had attained a certain standing were "called" to it to take part in the important exercises of the house. After c.1600, however, this was popularly assumed to mean the bar in a courtroom, which was the wooden railing marking off the area around the judge's seat, where prisoners stood for arraignment and where a barrister (q.v.) stood to plead. As the place where the business of court was done, bar in this sense had become synonymous with "court" by early 14c.
bar (n.4)
unit of pressure, coined 1903 from Greek baros "weight," related to barys "heavy" (see grave (adj.)).