Consider a long straight wire carrying a uniform charge per unit lengthλ.
Let the Gaussian surface be a cylinder as the field generated by this charge carrying wire will be radially outward, uniform and symmetrical.
Thus according to the gauss law the electric field at the distance.r.from the wire is given as
ϕ=∬sE⋅ds
ϕ=λL∈0
dAis the infinitesimal surface element=2πrL
Now Substituting the values in the above formula, we get
E=λ2π∈0r