Military rank
Ancient: 

Greek: From 501 BC, the Athenians annually elected ten individuals to the rank of strategos, one for each of the ten "tribes" that had been created with the founding of the democracy. Strategos means "army leader" and is usually translated as "general". Originally these generals worked together with the old polemarchos ("warlord") but over time the latter figure was absorbed into the generalship: each of the ten generals would rotate as polemarch for one day, and during this day his vote would serve as tie-breaker if necessary.
The ten generals were equal to one another;  there was no hierarchy among them.  However, a basic form of democracy was in effect: for example, at the Battle of Marathon in 490 BC, the generals determined the battle plan by majority vote. Particular assignments might have been given to individual generals; inevitably there was a regular division of responsibilities.
The rank that was subordinate to a top general was a taxiarchos or taxiarhos, something akin to the modern brigadier. In Sparta, however, the title was "polemarchos". Below this was the syntagmatarchis, which can be translated as "leader of a regiment" (syntagma) and was therefore like a modern colonel. Below him was the tagmatarches, a commanding officer of a tagma (near to the modern battalion). The rank was roughly equivalent to the legatus of a Roman legion. Next was the lokhagos, an officer who led an infantry unit called a lokhos that consisted of roughly a hundred men, much the same as in a modern company led by a captain.
A Greek cavalry (hippikon) regiment was called a hipparchia and was commanded by an epihipparch. The unit was split into two and led by two hipparchos or hipparch, but Spartan cavalry was led by a hipparmostes. A hippotoxotès was a mounted archer. A Greek cavalry company was led by a tetrarchès or tetrarch.
The rank and file of the military in most of the Greek city states was composed of ordinary citizens. Heavily armed foot soldiers were called hoplitès or hoplites and a hoplomachos was a drill or weapons instructor.
Once Athens became a naval power, the top generals of the land armies had authority over the naval fleets as well. Under them, each warship was commanded by a trièrarchos or trierarch, a word which originally meant "trireme officer" but persisted when other types of vessels came into use. Moreover, as in modern navies, the different tasks associated with running a ship were delegated to different subordinates. Specifically, the kybernètès was the helmsman, the keleustēs managed the rowing speed, and the trièraulès was the flute player who maintained the strike rate for the oarsmen. Following further specialization, the naval strategos was replaced by a nauarchos, a sea officer equating to an admiral.
With the rise of Macedonia under Philip II of Macedon and Alexander the Great, the Greek military became professional, tactics became more sophisticated and additional levels of ranking developed. Foot soldiers were organized into heavy infantry phalanxes called phalangites. These were among the first troops ever to be drilled, and they fought packed in a close rectangular formation, typically eight men deep, with a leader at the head of each column (or file) and a secondary leader in the middle so that the back rows could move off to the sides if more frontage was needed.
A tetrarchia was a unit of four files and a tetrarchès or tetrarch was a commander of four files; a dilochia was a double file and a dilochitès was a double-file leader; a lochos was a single file and a lochagos was a file leader; a dimoiria was a half file and a dimoirites was a half-file leader. Another name for the half file was a hèmilochion with a hèmilochitès being a half-file leader.
Different types of units, however, were divided differently and therefore their leaders had different titles. For example, under a numbering system by tens, a dekas or dekania was a unit of ten led by a dekarchos, a hekatontarchia was a unit of one hundred led by a hekatontarchos and a khiliostys or khiliarchia was a unit of a thousand led by a khiliarchos.
The cavalry, for which Alexander became most famous (in a military sense), grew more varied. There were heavy cavalry and wing cavalry (ilè) units, the latter commanded by an ilarchos.

Roman: The use of formalized ranks came into widespread use with the Roman legions after the reforms by Marius. Comparisons to modern ranks, however, can only be loose because the Roman army's command structure was very different from the organizational structure of its modern counterparts, which arose from the early modern, Thirty Years' War mercenary companies, rather than from the writings of fourth-century Roman writer Vegetius and Caesar's commentaries on his conquest of Gaul and the civil war.
Military command properly so-called was a political office in Rome. A commander needed to be equipped with imperium, a politico-religious concept. The king who possessed it (the rex sacrorum) was strictly forbidden to have it to avoid a return to the monarchy. In the republic, commanding was confined to consuls or (seldom) to praetors, or in cases of necessity a dictator. Proconsuls, after the establishment of the office, were used. In imperial times, each legion was commanded by the emperor, who was technically either consul or proconsul.
The commander could appoint a deputy, a so-called legate (legatus). The association of "legatus" with "legion" is folk etymology, as the meaning of legatus is "proxy" or "envoy". Legates were typically drawn from the Roman Senate for three-year terms. The political nature of high military command was even reflected here, in that legions were always subordinate to the governor, and only the second and further legions stationed in a province had their own legatus legionis. The real commanders and the legates together were, in modern terms, the general officers.
Immediately beneath the commander (or his legate) were six military tribunes (tribuni militum), five of whom were young men of equestrian rank and one of whom was a nobleman who was headed for the senate. The latter is called laticlavian tribune (tribunus laticlavius) and was second in command. If in modern divisions the deputy commander is a brigadier general, the laticlavian tribune can perhaps be translated with this rank, though he commanded no formation of his own. The other tribunes are called tribuni angusticlavii and are equivalent to staff officers in both senses of the term: of ranks major, lieutenant colonel, colonel, and with administrative duties. They did not command a formation of their own. The term military tribune is even sometimes translated into English as "colonel"—most notably by the late classicist Robert Graves in his Claudius novels and his translation of Suetonius' Twelve Caesars—to avoid confusion with the political "tribunes of the people"; in addition, they must not either be confused with the "military tribunes with consular authority", who in early republican times could replace the consuls.
The third highest officer of a legion, above the angusticlavian tribunes, was the praefectus castrorum. He, too, would have a colonel's rank in modern armies, yet he differed much from the tribunes in that his office was not part of the rather administrative cursus, but normally filled by former centurions. (Modern armies have a similar distinction on a lower scale—i.e., between commissioned and non-commissioned officers.)
The fighting men in the legion were formed into "ranks", rows of men who fought as a unit. Under Marius's new system, legions were divided into ten cohorts (cohortes) (roughly equivalent to battalions and immediately subject to the legion), each consisting of three manipula, each of them of two centuries (a rather small company in modern terms), each consisting of between 60 and 160 men. Each century was led by a centurion (centurio, traditionally translated as captain), who was assisted by a number of junior officers, such as an optio. Centuries were further broken into ten contubernia of eight soldiers each. The manipula were commanded by one of their two centurions, the cohorts by one of their three manipulum's centurions; the most senior cohort-commanding centurions was called primus pilus. The ranks of centurions in the individual cohorts were, in descending order, pilus prior, pilus posterior, princeps prior, princeps posterior, hastatus prior, and hastatus posterior. Individual soldiers were referred to as soldiers (milites) or legionaries (legionarii).

Mongol: See Mongol military tactics and organization.

Turk: There were no ranks in the modern sense of a hierarchy of titles, although the army was organized into a hierarchical command.