Bile acids (BAs) exert a profound influence on the body’s pathophysiology by intricately shaping the composition of gut bacteria. However, the complex interplay between BAs and gut microbiota has impeded a systematic exploration of their impact on intestinal bacteria. Initially, we investigated the effects of 21 BAs on the growth of 65 gut bacterial strains in vitro. Subsequently, we examined the impact of BAs on the overall composition of intestinal bacteria, both in vivo and in vitro. The results unveiled distinct effects of various BAs on different intestinal strains and their diverse impacts on the composition of gut bacteria. Mechanistically, the inhibition of intestinal strains by BAs occurs through the accumulation of these acids within the strains. The intracellular accumulation of deoxycholic acid (DCA) significantly influenced the growth of intestinal bacteria by impacting ribosome transcription and amino-acid metabolism. The metabolomic analysis underscores the pronounced impact of DCA on amino-acid profiles in both in vivo and in vitro settings. This study not only elucidates the effects of BAs on a diverse range of bacterial strains and their role in shaping the gut microbiota but also reveals underlying mechanisms essential for understanding and maintaining a healthy gut microbiota.