Noise-like square pulses (NLSPs) have been experimentally investigated in both normal and anomalous dispersion regimes. A chirped fiber Bragg grating (CFBG) has been employed as a dispersion management element in the compact linear-cavity mode-locked Yb-doped fiber laser. The net cavity dispersion could be switched from large anomalous dispersion (-2.71 ps) to large normal dispersion (+5.33 ps 2), depending on the direction of CFBG inserting in laser cavity. Two kinds of NLSPs with different temporal profiles are achieved in the proposed laser. In anomalous dispersion regime, the square pulse duration can be tuned from 0.91 ns to 5.39 ns, and the maximum square pulse energy is 39.57 nJ. In normal dispersion regime, the top of the pulse is flatter, the square pulse duration can be tuned from 0.89 ns to 5.97 ns, and the maximum square pulse energy is slightly higher, up to 40.17 nJ. The output laser is linearly polarized.