How to remove blank lines from text files or js files

--

By running this command…

egrep --include=*.js -lRZ "^$"  ./ | xargs -0 -l   sed -i -e '/^$/d'

Just two parts to it, search for all *.js files and use sed to replace new lines with nothing.

That’s all.

--

--

Kumar Chetan Sharma

C0d3🐵 from 🇮🇳. selfTaught. 😨 of CS, Algos & DS. World famous 👨‍🍳 at home. Pro Level Pro-Crastinator. Man child. Dad of (✿◠‿◠)(◠‿◠✿)