常用文本处理命令
1 ①去掉开头 # 的行
grep -v "#" nginx.conf.bak
2 ①去掉开头 # 的行;②去掉空行
grep -v "#" nginx.conf | grep -v "^$"
3 ①去掉开头 # 的行;②去掉空行;③输出到新的文件中
grep -v "#" nginx.conf | grep -v "^$" > nginx.conf.swp
4 ①统计文件中包含文本的个数
grep -c "server_name" www.01wneo.com