删除PHP配置文件中的注释行删除注释行:sed -i '/^;.*/d' filename删除空行:sed -i /^[[:space:]]*$/d filename如果只是放在内存里预览,不直接在文件上生效,去掉 -i 参数。