The effects of the front wall and aft wall sub-cavities in the flow field of a confined supersonic deep cavity are numerically investigated. The turbulent simulations are carried out by deploying a finite volume-based explicit density-based solver in the OpenFOAM framework in conjunction with the k − ω SST (Shear Stress Transport) turbulence model. A cavity with a length-to-depth ratio of three placed in a confined passage is considered in the study. The freestream Mach number at the entrance of the passage is approximately 1.71. The addition of the sub-cavity of lengths ranging between 0.2 and 0.3 times the length of the main cavity in the front wall and the aft wall, significantly affects the frequencies of cavity oscillations as obtained from the spectral signature. The front wall sub-cavity of length ratio 0.2 reduces the dominant frequency by almost 60 percent as compared to the baseline cavity. The analysis and comparison of the flow field using the numerical schlieren in both configurations reveal a significant alteration in the flow field. The flow visualization provides a distinct understanding of the attenuation and enhancement of pressure oscillations obtained through spectral analysis in the presence of sub-cavities.