  We have obtained maps of the 1.25mm thermal dust emission and the molecular
gas emission over a region of 20' by 10' arcmin around the Trifid Nebula (M20),
with the IRAM 30m and the CSO telescopes as well as in the mid-infrared
wavelength with ISO and SPITZER. Our survey is sensitive to features down to
N(H2) \sim 10^{22} cm-2 in column density. The cloud material is distributed in
fragmented dense gas filaments (n(H2) \sim 1000 cm-3) with sizes ranging from 1
to 10 pc. A massive filament, WF, with properties typical of Infra Red Dark
Clouds, connects M20 to the W28 supernova remnant. These filaments pre-exist
the formation of the Trifid and were originally self-gravitating. The fragments
produced are very massive (100 Msun or more) and are the progenitors of the
cometary globules observed at the border of the HII region. We could identify
33 cores, 16 of which are currently forming stars. They are usually
gravitationally unbound and have low masses of a few Msun. The densest starless
cores (several 10^5 cm-3) may be the site for the next generation of stars. The
physical gas and dust properties of the cometary globules have been studied in
detail and have been found very similar. They all are forming stars. Several
intermediate-mass protostars have been detected in the cometary globules and in
the deeply embedded cores. Evidence of clustering has been found in the shocked
massive cores TC3-TC4-TC5. M20 is a good example of massive-star forming region
in a turbulent, filamentary molecular cloud. Photoionization appears to play a
minor role in the formation of the cores. The observed fragmentation is well
explained by MHD-driven instabilities and is usually not related to M20. We
propose that the nearby supernova remnant W28 could have triggered the
formation of protostellar clusters in nearby dense cores of the Trifid.
