sed

Remove empty lines in a file

sed -i '/^\s*$/d' <file name>

OR

sed -i 's/ //g'

Delete blank lines

sed -i '/^[[:space:]]*$/d'

Remove all indentation

sed 's/^[[:space:]]*//g'

Last updated