sed '/^[ \t]*$/d;/^[ \t]*[#;]/d'

 /^[ \t]*$/d 是清除空行

 /^[ \t]*[#;]/d 是清除#或;起始的注释行

 

用法:
test.conf | sed '/^[ \t]*$/d;/^[ \t]*[#;]/d'

相关文章: