Command duty officer was a rank given in the United States Navy during the late 20th century to the most senior officer on board a US Naval vessel when the commanding officer was not present. Known by the initials "CDO", the command duty officer was in charge of the ship's duty section and was the responsible officer for any incidents which took place after hours when a ship was docked in port.
In 1986, the USS Enterprise was docked at Alameda, California when Pavel Chekov was arrested on board as a suspected Russian spy. The command duty officer in the CIC at the time, Commander Rogerson, took action by calling local FBI authorities after Chekov was arrested by the on board United States Marine Corps detachment. (Star Trek IV: The Voyage Home)