In my U.S. Navy experience (submarine force), the in-port officer that was on-duty and in charge of the ship in the CO’s absence was referred to as the Ship’s Duty Officer (SDO).
As previously noted, the SDO was also a qualified Officer of the Deck (OOD), and thus qualified to take the boat to sea.
The term “Command Duty Officer” (CDO) was a more generic term that was generally used only for shore commands. For example, the shore-based submarine squadron I was later assigned to had a daily CDO.
–robby (former qualified submarine OOD/SDO & sub squadron CDO)