X-ray observations are playing an increasingly important role in the study of galaxies. With its arcsecond spatial resolution, Chandra in particular has made a significant impact on our understanding of discrete X-ray source populations, which mostly represent various stellar end-products [e.g., low- and high-mass X-ray binaries (LMXBs and HMXBs) and supernova remnants (SNRs)] as well as active galactic nuclei (AGNs). The resolution also allows for a clean excision of such sources from the data so low-surface brightness emission (e.g. from diffuse hot gas) can be mapped out. An under-appreciated aspect of Chandra is its spectroscopic capability in the study of diffuse hot gas when the low- and high-energy grating instruments are used. Although the sensitivities of the instruments are quite limited, the existing observations of a dozen or so bright objects (AGNs and LMXBs) have yielded data of high enough quality for unprecedented X-ray absorption line spectroscopic measurements of the global hot gas in and around our Galaxy. Useful constraints have also been obtained on the overall content of hot gas around galaxies within certain impact distances of the sight lines toward the AGNs. These measurements, compared with physical models and simulations of the hot gas, are shedding important insights on its relationship to the feedback from stars and AGNs. These aspects of the Chandra's legacy are reviewed in the following.