In this work, Mach 1.8 flow over a shallow open cavity is studied through time-resolved schlieren images as well as unsteady pressure measurements respectively. Additionally, the cavity shear layer dynamics are explored using modal decomposition techniques namely; proper orthogonal decomposition (POD) and spectral proper orthogonal decomposition (SPOD). The results display that the cavity undergoes a self-sustaining oscillation with a number of modes/tones that are closely related to the modified Rossiter relation. Depending on the cavity oscillation, the time-resolved images reveal various complex flow features. Through modal analysis, the shear layer structures which are responsible for the cavity oscillation are identified. It is understood that POD requires several hundreds of modes to capture 67.3% of the total intensity for resembling the cavity flow field, while SPOD shows 65.7% of the total intensity is available in the 1st mode to reconstruct the cavity flow field. Further, modal analyses have demonstrated that cavity oscillatory frequencies are very similar to unsteady pressure measurement and the modified Rossiter relation. We confirmed that, both these techniques can be successfully applied to cavity flows and are complementary.