Electric field intensity due to an infinitely long uniformly charged wire at point P at distance r from it is obtained as follows:
Consider a thin cylindrical Gaussian surface S with charged wire on it axis and point P on its surface, then net electric flux through surface S is

Φ = O+EA +0 or Φ = E.2πrl
But by Gauss’s theorem,
Φ =q/ε0 = λl/ε0
where q is the charge on length l of wire enclosed by cylindrical surface S and is uniform linear charge density of wire.

Thus, electric field of a line charge is inversely proportional to distance directed normal to the surface of charged wire.