使用grep命令过滤到掉文件中的内容 发表于 2018-10-18 更新于 2022-03-10 分类于 Linux 过滤掉注释 1cat /etc/ntp.conf | grep -v '^#' 过滤掉空行 1cat /etc/ntp.conf | grep -v '^#' 过滤掉注释和空行1cat /etc/ntp.conf | grep -Ev '^#|^$'