The paper exhibits a unified approach to large deviations of dynamical systems and stochastic processes based on the existence of a pressure functional and on the uniqueness of equilibrium states for certain dense sets of functions. This enables us to generalize recent results from [OP, Y, and D] on large deviations for dynamical systems, as well, as to recover Donsker-Varadhan’s [DV2] large deviation estimates for Markov processes.