查阅文件技巧 一、打印除匹配行之外的其它行,使用grep -v 打印行首不包含$或#的注释行:cat file| grep -v ^$ | grep -v ^# 打印某文本文件行首不包含$或#的注释行:egrep -v "^#|^$" nginx.conf.default 知识点: 1、行首-------^ 2、正则表达式“或”-------| posted on 2018-03-05 10:19 破霜风 阅读( ...) 评论( ...) 编辑 收藏 转载于:https://www.cnblogs.com/victorfrost/p/8507595.html