A duty officer is the person in command on the bridge of a starship or in the command center of a space station when the commanding officer or a senior officer is not present. A duty officer is typically of the rank of ensign or higher.
Lieutenant Monroe was the duty officer when the USS Enterprise-D struck several quantum filaments in 2368. She was killed when an impact shorted out the helm console while she was sitting at it, leaving inexperienced Counselor Deanna Troi, who carried the rank of lieutenant commander, as the highest ranking officer left on the bridge. (TNG: "Disaster")
In the 20th century United States Navy, a position existed known as the Command Duty Officer which was similar in its duties and function to the 23rd and 24th century counterpart. (Star Trek IV: The Voyage Home)