grep命令-v参数过滤以井号、分号开头的注释信息行及空白行
grep命令-v参数(反向选择)分别去掉所有以#(井号)和;(分号)开头的注释信息行,对于剩余的空白行可以再用^$来表示并反选过滤
[root@rhel7 samba]# cat smb.conf | grep -v "#" | grep -v ";" | grep -v "^$"
[global]
workgroup = MYGROUP
server string = Samba Server Version %v
log file = /var/log/samba/log.%m
max log size =
security = user
passdb backend = tdbsam
load printers = yes
cups options = raw
[homes]
comment = Home Directories
browseable = no
writable = yes
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
grep命令-v参数过滤以井号、分号开头的注释信息行及空白行的更多相关文章
- NO22 Linux正则表达式--grep命令常用参数
Linux正则表达式: 一.基础正则第一波字符说明: 示例: 二.基础正则第二波字符说明: 三.基础正则第二波字符说明: 示例: grep:一般常用参数 示例:+和* ?和.: |: () ...
- Linux命令文件查看过滤
Linux命令篇 1.查看一个文件的后100行的命令: tail -n 100 Linux下查看文件前几行一般用head -n xx,查看后面几行用tail -n xx.除此之外,还有: tail - ...
- day13 grep命令
day13 grep命令 linux三剑客之grep命令 介绍 grep(global search regular expression(RE) and print out the line,全面搜 ...
- Linux学习历程——Centos 7 grep命令
一.命令简介 grep 命令用于在文本中执行关键词搜索,并显示匹配的结果. 由于grep命令参数很多,这里只列出一些常用的参数. 参数 作用 -b 将可执行文件当作文本文件来搜索 -c 仅显示找到的行 ...
- shell脚本--内容查找之grep命令
grep命令可以检索文件中包含关键字(可以使用正则)的行,默认区分大小写. ubuntu@ubuntu:~/test$ cat test.txt this is linux this is Linux ...
- grep命令相关用法
grep命令相关参数: -i:忽略大小写 --color:高亮显示匹配到的信息 -v:反向查找,没匹配到的行显示出来 -o:只显示被模式匹配到的串本身 正则表达式: .*:任意长度的任意字符,贪婪模式 ...
- Linux Shell基础 管道符和grep命令
概述 管道符:管道符使用"丨"代表.如"命令1丨命令2".表示命令 1 的正确输出作为命令 2 的操作对象.命令 1 必须有正确输出,而命令 2 必须可以处理命 ...
- linux中的grep命令用法
原文请移驾:http://blog.csdn.net/greytree/article/details/428532 grep -- print lines matching a pattern (将 ...
- 【linux】linux命令lsof和grep命令的配合使用---linux根据端口查看PID,根据PID关键字高亮显示
lsof命令,根据端口,查看进程PID lsof -i: ps命令+grep命令 --color参数,根据PID查看进程详情,高亮显示关键字 ps -ef | grep --color=always
随机推荐
- IIS7.5中调试.Net 4.0网站出现无厘头500错误的解决办法 (转)
刚刚 部署了ii7的dll的有x86写的,就会出现以下这样的问题 iis 7 x86,Could not load file or assembly 'Name' or one of its depe ...
- vs2010使用svn--浅谈AnkhSvn
(1)建立本地的服务器版本.Subversion->Add to Subversion 此功能的作用是从将新创建的工程添加到svn服务器上 (2)从svn检出 Subversion->Op ...
- [PowerShell Utils] Automatically Change DNS and then Join Domain
I would like to start a series of blog posts sharing PowerShell scripts to speed up our solution ope ...
- Tensorflow Serving 模型部署和服务
http://blog.csdn.net/wangjian1204/article/details/68928656 本文转载自:https://zhuanlan.zhihu.com/p/233614 ...
- 浅谈APP流式分页服务端设计(转)
http://www.jianshu.com/p/13941129c826 a.cursor游标式分页 select * from table where id >cursor limit pa ...
- (转)思考:矩阵及变换,以及矩阵在DirectX和OpenGL中的运用问题:左乘/右乘,行优先/列优先,...
转自:http://www.cnblogs.com/soroman/archive/2008/03/21/1115571.html 思考:矩阵及变换,以及矩阵在DirectX和OpenGL中的运用1. ...
- matlab中subplot函数的功能 类似python
原文:http://blog.163.com/my_it_dream_pwj/blog/static/17841430520112294342649/ 和python 中类似 subplot 功能 分 ...
- External component has thrown an exception
C#调用c++的DLL报错:External component has thrown an exception, 也没有log产生,怎么回事那? [解决方法] 这是因为c++的程序报错了,而且没有c ...
- [Git] Change the commit message of my last commit
Did you make a typo in your last commit message? No problem, we can use the git --amend command to c ...
- 使用Robot Framework做接口测试
http://chuansong.me/n/1858477 1.RF框架 1.1 RF框架介绍Robot Framework 框架是一个通用的测试框架,一直是由诺西网络(Nokia Siemens N ...