The viscous linear stability of four classes of incompressible flows inside rectangular containers is studied numerically. In the first class the instability of flow through a rectangular duct, driven by a constant pressure gradient along the axis of the duct (essentially a two-dimensional counterpart to plane Poiseuille flow – PPF), is addressed. The other classes of flow examined are generated by tangential motion of one wall, in one case in the axial direction of the duct, in another perpendicular to this direction, corresponding respectively to the two-dimensional counterpart to plane Couette flow (PCF) and the classic lid-driven cavity (LDC) flow, and in the fourth case a combination of both the previous tangential wall motions. The partial-derivative eigenvalue problem which in each case governs the temporal development of global three-dimensional small-amplitude disturbances is solved numerically. The results of Tatsumi & Yoshimura (1990) for pressure-gradient-driven flow in a rectangular duct have been confirmed; the relationship between the eigenvalue spectrum of PPF and that of the rectangular duct has been investigated. Despite extensive numerical experimentation no unstable modes have been found in the wall-bounded Couette flow, this configuration found here to be more stable than its one-dimensional limit. In the square LDC flow results obtained are in line with the predictions of Ding & Kawahara (1998b), Theofilis (2000) and Albensoeder et al. (2001b) as far as one travelling unstable mode is concerned. However, in line with the predictions of the latter two works and contrary to all previously published results it is found that this mode is the third in significance from an instability analysis point of view. In a parameter range unexplored by Ding & Kawahara (1998b) and all prior investigations two additional eigenmodes exist, which are both more unstable than the mode that these authors discovered. The first of the new modes is stationary (and would consequently be impossible to detect using power-series analysis of experimental data), whilst the second is travelling, and has a critical Reynolds number and frequency well inside the experimentally observed bracket. The effect of variable aspect ratio $Aın0.5,4$ of the cavity on the most unstable eigenmodes is also considered, and it is found that an increase in aspect ratio results in general destabilization of the flow. Finally, a combination of wall-bounded Couette and LDC flow, generated in a square duct by lid motion at an angle $\phiın(0,\pi/2)$ with the homogeneous duct direction, is shown to be linearly unstable above a Reynolds number $\Rey\,=\,800$ (based on the lid velocity and the duct length/height) at all $\phi$ parameter values examined. The excellent agreement with experiment in LDC flow and the alleviation of the erroneous prediction of stability of wall-bounded Couette flow is thus attributed to the presence of in-plane basic flow velocity components.