Ordonner vs. commander

In French, 'ordonner' and 'commander' both translate into English as 'to order' or 'to command'. However, they are used in slightly different contexts and carry different nuances.

Ordonner

'Ordonner' means to give an authoritative command or direction, often in a formal or organizational context.
Le général a ordonné à ses troupes de se préparer pour la bataille.
(The general ordered his troops to prepare for battle.)
Lentreprise a ordonné aux employés de changer leurs mots de passe.
(The company ordered the employees to change their passwords.)
Le médecin lui a ordonné de prendre du repos.
(The doctor ordered him to take some rest.)

Commander

'Commander' generally refers to ordering in the sense of requesting something, especially goods or services, but can also mean giving orders in a less formal context than 'ordonner'.
J'ai commandé une pizza par téléphone.
(I ordered a pizza over the phone.)
Elle commande toujours ses livres en ligne.
(She always orders her books online.)
Le capitaine commande son équipage avec fermeté.
(The captain commands his crew with firmness.)

Summary

'Ordonner' and 'commander' are both French verbs meaning 'to order', but they are used differently. 'Ordonner' is used more often in formal or authoritative contexts to give direct orders, while 'commander' typically refers to requesting goods or services, although it can also be used to give orders in a less formal manner than 'ordonner'.