A two-dimensional particle-in-cell simulation is carried out to study the focusing effects of the long proton beam propagating in background plasmas. It is found that the smooth beam, with the long length and the small density gradient profile, is focused to high density. The sharp beam, with long length and the large density gradient profile, is modulated into many high density and periodic short beam pulses due to the wakefield induced by the beam. In addition, increasing the plasma density and adopting the non-uniform plasmas are the effective ways to reduce the wakefield.