sed命令用法小记
![0cee2f10ead96b325c9169c9490bcc9a.png](https://i-blog.csdnimg.cn/blog_migrate/10ff65c59366000ec3812cbb6f31b088.png)
![d2b5172815c16bbe947286eb47e52e15.gif](https://i-blog.csdnimg.cn/blog_migrate/c09342d8b72b7daf7cf7c5bcaf39649e.gif)
版本:CentOS7
▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼ ▼
好久没更新文章了,项目的事情太多,总得给自己的懒惰找个借口,哈哈~
话不多说进入正题
创建测试数据
[alisca@spark02 a]$ cat data#test the sedThis is the header lineThis is the first data lineThis is the second data lineThis is the last line
查看非注释行和非空行的数据
[alisca@spark02 a]$ sed -n '/^#/!{/^$/!p}' data This is the header lineThis is the first data lineThis is the second data