An invariant ensemble of N × N random matrices can be characterised by a joint distribution for eigenvalues P (λ 1 , · · · , λ N ). The study of the distribution of linear statistics, i.e. of quantities of the formis a given function, appears in many physical problems. In the N → ∞ limit, L scales as L ∼ N η , where the scaling exponent η depends on the ensemble and the function f (x). Its distribution can be written under the form Pis the Dyson index. The Coulomb gas technique naturally provides the large deviation function Φ(s), which can be efficiently obtained thanks to a "thermodynamic identity" introduced earlier. We conjecture the pre-exponential function A N,β (s). We check our conjecture on several well controlled cases within the Laguerre and the Jacobi ensembles. Then we apply our main result to a situation where the large deviation function has no minimum (and L has infinite moments) : this arises in the statistical analysis of the Wigner time delay for semi-infinite multichannel disordered wires (Laguerre ensemble). The statistical analysis of the Wigner time delay then crucially depends on the pre-exponential function A N,β (s), which ensures the decay of the distribution for large argument.