Nature and technical applications abound with thin viscous flows, ranging from the lava flow on volcanoes to the lubricating layer around confined bubbles in the microchannels of Lab-on-a-Chip devices. Countless are the examples where coating flows arise in industrial processes. We all have probably already observed that thin-film flows often form well-defined fascinating patterns, as the tears in a glass of wine, or the crystalline-like pattern of pendent droplets under the kitchen lid. Yet, the nonuniformity of the film thickness is not always desirable and calls for the development of flow-control strategies. Despite the fact that the mechanisms underpinning the pattern formation in thin liquid films are known for simple, often one-dimensional, geometries, little is known when thin films coat more geometrically complex two-dimensional surfaces. The aim of this thesis is to investigate the pattern formation in thin-film flows for different configurations. The interface of a free-surface flow can deform as a result of hydrodynamic instabilities or due to boundary conditions. Here, we focus on both the gravity-induced destabilization of the liquid interface of thin films flowing on curved and inclined geometries and the pattern formation in thin films connected to thicker liquid regions via menisci. We first consider the Rayleigh-Taylor instability when a fixed liquid quantity coats the underneath of a substrate as well as the fingering instability when the liquid flows onto the substrate. We show that both instabilities can be suppressed by carefully controlling the substrate geometry. A stable flow can be harnessed to produce thin hemispherical elastic shells in a very robust and versatile manner. Due to the intrinsic space and time dependence of these flows on curved geometries, classic hydrodynamic stability analyses are ruled out. Hence, we apply nonmodal optimal transient growth techniques, as recently used to develop understanding of the transition to turbulence in shear flows, for the study of the pattern formation in this entirely different class of flows. The substrate curvature is found to play a key role in the stabilization of the Rayleigh-Taylor instability through the gravity component parallel to the substrate. The resulting increased draining flow makes the film asymptotically stable with respect to infinitesimal perturbations. We demonstrate that the linearly most amplified pattern, in agreement with the performed experiments and nonlinear numerical simulations, differs from the classic one of a liquid coating the underneath of a planar horizontal substrate. Strikingly, we show that these Rayleigh-Taylor-instability patterns are very likely to be at the origin of the pattern selection in karst formations encountered in limestone caves. In the last part of this thesis, we aim at providing a detailed theoretical and numerical characterization of the thin-film profiles around confined bubbles and droplets in microchannels in order to better predict their dynamics, which is still an open question despite the dramatic increase in popularity of microfluidic devices. In spite of the broad range of scales considered, all the thin-film flows can be described by similar lubrication equations. We show that the unidirectional dominant advection encountered in this work is responsible for breaking the symmetry of the problem and yielding anisotropic patterns.