Trimethoprim and the sulfonamides (e.g. Bactrim) inhibit folate metabolism. Folate is needed in DNA synthesis as seen in the flowchart below.
Macrolides, aminoglycosides, and tetracyclines inhibit the formation of ribosomes which is needed in RNA synthesis.
The ß-Lactams (e.g. penicillins) and glycopeptide (e.g. vancomycin) antibiotics inhibit cell wall synthesis.
The polymyxins disrupt cytoplasmic membrane function while the quinolones and rifampicin inhibit nucleic acid synthesis.