Aims. We aim to investigate the impact of the ionized radiation from the M16 H II region on the surrounding molecular cloud and on its hosted star formation. Methods. To present comprehensive multi-wavelength observations towards the M16 H II region, we used new CO data and existing infrared, optical, and submillimeter data. The 12 CO J=1-0, 13 CO J=1-0, and C 18 O J=1-0 data were obtained with the Purple Mountain Observatory (PMO) 13.7m radio telescope. To trace massive clumps and extract young stellar objects (YSOs) associated with the M16 H II region, we used the ATLASGAL and GLIMPSE I catalogs, respectively. Results. From CO data, we discern a large-scale filament with three velocity components. Because these three components overlap with each other in both velocity and space, the filament may be made of three layers. The M16 ionized gas interacts with the largescale filament and has reshaped its structure. In the large-scale filament, we find 51 compact cores from the ATLASGAL catalog, 20 of them being quiescent. The mean excitation temperature of these cores is 22.5 K, while this is 22.2 K for the quiescent cores. This high temperature observed for the quiescent cores suggests that the cores may be heated by M16 and do not experience internal heating from sources in the cores. Through the relationship between the mass and radius of these cores, we obtain that 45% of all the cores are massive enough to potentially form massive stars. Compared with the thermal motion, the turbulence created by the nonthermal motion is responsible for the core formation. For the pillars observed towards M16, the H II region may give rise to the strong turbulence.