Near-fault strong ground motion of strike-slip and dip-slip of vertical and inclined rectangular fault in half-space and layered half-space is analyzed by dislocation source model. The Fourier spectra ratio of ground motion is adopted to study the characteristics of near-fault ground motion. For both slip models, near-fault strong ground motion with high amplitude is located in a narrow belt area along the projection of the fault on the ground and mainly controlled by the sub-faults nearby. Directivity of strike-slip fault is more dominant in long period for components perpendicular to the fault, and more dominant in long period for components parallel to the fault for dip-slip fault. The deeper the location of the source is, the more slowly the amplitude of ground motion attenuates.There is obvious hanging wall effect in ground motion of inclined fault, and the spatial distribution of ground motion is asymmetric which coincides with observational data. Finally, a fitting function of spatial distribution for near-fault ground motion is proposed and compared with near source factors of the 1997 Uniform Building Code of USA.