sed -e /^$/d *.txt sed 'g/^$/d' -i *.txt
如何从文本文件中的每一行的开头和结尾删除空格?
$sed 's/^ *//; s/ *$//; /^$/d' file.txt `s/^ *//` => left trim `s/ *$//` => right trim `/^$/d` => remove empty line