How to remove blank lines from text files or php files or js files or…

By running this command…

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

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

That’s all.

Leave a comment

Your email address will not be published. Required fields are marked *