We present a shock capturing method for large-eddy simulation of turbulent flows. The proposed method relies on physical mechanisms to resolve and smooth sharp unresolved flow features that may otherwise lead to numerical instability, such as shock waves and under-resolved thermal and shear layers. To that end, we devise various sensors to detect when and where the shear viscosity, bulk viscosity and thermal conductivity of the fluid do not suffice to stabilize the numerical solution. In such cases, the fluid viscosities are selectively increased to ensure the cell Peclet number is of order one so that these flow features can be well represented with the grid resolution. Although the shock capturing method is devised in the context of discontinuous Galerkin methods, it can be used with other discretization schemes. The performance of the method is illustrated through numerical simulation of external and internal flows in transonic, supersonic, and hypersonic regimes. For the problems considered, the shock capturing method performs robustly, provides sharp shock profiles, and has a small impact on the resolved turbulent structures. These three features are critical to enable robust and accurate large-eddy simulations of shock flows.