linux下删除空白行命令

删除空白行,或者只有空格或TAB的行

sed -i '/^[ \t]*$/d' filename
awk '/^[ \t]*$/{next}{print > filename}' filename

你可能感兴趣的:(linux命令及shell)