cat elasticsearch.yml | grep -v ^# |grep -v ^$grep "^[^#]" kk.txt 不以#字符的其他字符 开头的。因为[ ]指定了是单个字符,所以就把空行排除了
grep -v "^$|[#;]" kk.txt ////这个是 ^$ 或者 含有#的,^被或者符 分开了,^过不去的grep -v "^$|^#" kk.txt /////既然过不去那就只能 在后面加上^了