The line "To the shores of Tripoli" refers to the First Barbary War (1801-1805), and specifically the Battle of Derna in 1805. The conflict involved war with the Barbary States (the Ottoman provinces of Tripoli, Algiers, and Tunis). The run up to the war and the war involved many names you have heard before in this blog (e.g. Bainbridge, Decatur, and others). The return of the bodies of the precursors to today's Navy SEALs has been an ongoing challenge in working with the governments of Tripoli.
Tripoli was founded in the 7th century BC by the Phoenicians, who named it Oea.
Tripoli is also known as Tripoli-of-the-West (Arabic: طرابلس الغرب Ṭarābulus al-Gharb), to distinguish it from its older Phoenician sister city Tripoli, Lebanon known in Arabic as Ṭarābulus al-Sham (طرابلس الشام) meaning "Levantine Tripoli." It is affectionately called The Mermaid of the Mediterranean (Arabic: عروسة البحر ʼarūsat el-baḥr; lit: "bride of the sea"), describing its turquoise waters and its whitewashed buildings. Tripoli is a Greek name that means "Three Cities," introduced in Western European languages through the Italian Tripoli. In Arabic: طرابلس it is called Ṭarābulus, Libyan Arabic: Ṭrābləs, Berber: Trables, from Ancient Greek: Τρίπολις Trípolis).
Around the beginning of the 3rd century AD, it became known as the Regio Tripolitana, meaning "region of the three cities," namely Oea (i.e., modern Tripoli), Sabratha and Leptis Magna.
The rebels codenamed the assault "Operation Mermaid Dawn" (Arabic: عملية فجر عروسة البحر ʻamaliyyat fajr ʻarūsat el-baḥr). As noted above, Tripoli's nickname is "The Mermaid" (Arabic: عروسة البحر ʻarūsat el-baḥr) (literally "bride of the sea").