Borrowed from French commander, from Latin commandāre, variant of commendāre. Doublet of encomendar.
Practice speaking and memorizing "comandar" and many other words and sentences in Portuguese.