linux 中grep 匹配制表符 和 换行符的命令

使用:

[root@dhcp-9-79 ~]# grep $'\n' log.txt 
[root@dhcp-9-79 ~]# grep $'\t' log.txt

这两个命令

[root@dhcp-9-79 ~]# ls
anaconda-ks.cfg log.txt mno.txt original-ks.cfg
[root@dhcp-9-79 ~]# cat log.txt 
  ok
[root@dhcp-9-79 ~]# grep $'\n' log.txt 
  ok
[root@dhcp-9-79 ~]# grep $'\t' log.txt 
  ok

总结

相关推荐