Nitriles are organic molecules with −C≡N as functional group and often toxic for living organisms. Detoxification can occur via nitrilases that degrade nitriles directly to carboxylic acids and ammonia, or with nitrile hydratases and amidases that convert nitriles to amides and subsequently to carboxylic acids and ammonia. Despite the knowledge of enzymatic degradation pathways, the influence of these compounds on the composition of bacterial communities is unknown. The tolerances of four phylogenetically different bacterial strains without known nitrile detoxification systems (Agrobacterium tumefaciens, Bacillus subtilis, Corynebacterium glutamicum, and Escherichia coli) to the toxic effects of nine nitriles and the corresponding carboxylic acids were determined. Based on these results, the effect of nitriles on diversity and composition of compost-derived bacterial communities was monitored over time by 16S rRNA gene amplicon-based and metagenome analyses. Acetone cyanohydrin, 2-phenylpropionitrile, and pyruvonitrile exhibited a lethal, phenylacetonitrile, 4-hydroxybenzonitrile, and cyclohexanecarbonitrile a growth-suppressing and succinonitrile, acetonitrile, and crotononitrile a growth-promoting effect on the studied communities. Furthermore, each nitrile had a specific community-shaping effect, e.g. communities showing growth-suppression exhibited high relative abundance of Paenibacillus. In general, analysis of all data indicated a higher resistance of Gram-positive than Gram-negative bacterial community members and test organisms to growth-suppressing nitriles. More than 70 putative nitrilase-encoding and over 20 potential nitrile hydratase-encoding genes were identified during analysis of metagenomes derived from nitrile-enrichments, underlining the high yet often unexplored abundance of nitrile-degrading enzymes.