According to Gauss law, one can write
4*\pi*Q = \int E dS.
Let us consider a cylindrical volume of radius r and length l with infinite thin charged thread on the axis. The total charge in this volume will be Q = \lambda*l where \lambda is a linear charge density. The surface area of the given volume is S = 2*\pi*r*l -- only through edge surface of this cylindrical volume the flux of E is nonzero. So,
4*\pi*\lambda*l = E * 2*\pi*r*l
E = 2*\lambda/r.
how did you get 2 λ / r ?