Properties and uses of the Wilson flow in lattice QCD