  We discuss the formation of cosmic strings or macroscopic color flux tubes at
the phase transition from the deconfinement to confinement phase in pure
Yang-Mills (YM) theory, such as SU($N$), Sp($N$), SO($N$), and Spin($N$), based
on the current understanding of theoretical physics. According to the
holographic dual descriptions, the cosmic strings are dual to fundamental
strings or wrapped D-branes in the gravity side depending on the structure of
the gauge group, and the reconnection probability is suppressed by
$\mathcal{O}(N^{-2})$ and $e^{-\mathcal{O}(N)}$, respectively. The pure YM
theory thus provides a simple realization of cosmic F- and D-strings without
the need for a brane-inflationary scenario or extra dimension. We also review
the stability of cosmic strings based on the concept of 1-form symmetry, which
further implies the existence of a baryon vertex in some YM theory. We
calculate the gravitational wave spectrum that is emitted from the cosmic
strings based on an extended velocity-dependent one-scale model and discuss its
detectability based on ongoing and planned gravitational-wave experiments. In
particular, the SKA and LISA can observe gravitational signals if the
confinement scale is higher than $\mathcal{O}(10^{12})\,\mathrm{GeV}$ and
$\mathcal{O}(10^{10})\,\mathrm{GeV}$ for SU($N$) with $N = \mathcal{O}(1)$,
respectively.
