Which one would be better:
sed -e '/^$/d' *.txt
sed 'g/^$/d' -i *.txt
Also, how do I remove spaces from beginning and end of each line in the text file?
$ sed 's/^ *//; s/ *$//; /^$/d' file.txt
`s/^ *//` => left trim
`s/ *$//` => right trim
`/^$/d` => remove empty line